public SQueriableLog buildFinalLog(final String callerClassName, final String callerMethodName, final SQueriableLog log) { final SQueriableLogBuilderFactory fact = BuilderFactory.get(SQueriableLogBuilderFactory.class); final SQueriableLogBuilder builder = fact.fromInstance(log); final String rawMessage = log.getRawMessage(); if (rawMessage.length() > MAX_MESSAGE_LENGTH) { final String truncatedMessage = rawMessage.substring(0, MAX_MESSAGE_LENGTH); builder.rawMessage(truncatedMessage); if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) { final StringBuilder stb = new StringBuilder(); stb.append("The queriable log message is too long and will be truncated to "); stb.append(MAX_MESSAGE_LENGTH); stb.append(" characters. The original message is '"); stb.append(rawMessage); stb.append("'. It will be truncated to '"); stb.append(truncatedMessage); stb.append("'"); logger.log(getClass(), TechnicalLogSeverity.INFO, stb.toString()); } } return builder.callerClassName(callerClassName).callerMethodName(callerMethodName) .userId(sessionProvider.getUserId()).clusterNode(sessionProvider.getClusterNode()) .productVersion(platformService.getSPlatformProperties().getPlatformVersion()) .done(); }
public SQueriableLog buildFinalLog(final String callerClassName, final String callerMethodName, final SQueriableLog log) { final SQueriableLogBuilderFactory fact = BuilderFactory.get(SQueriableLogBuilderFactory.class); final SQueriableLogBuilder builder = fact.fromInstance(log); final String rawMessage = log.getRawMessage(); if (rawMessage.length() > MAX_MESSAGE_LENGTH) { final String truncatedMessage = rawMessage.substring(0, MAX_MESSAGE_LENGTH); builder.rawMessage(truncatedMessage); if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) { final StringBuilder stb = new StringBuilder(); stb.append("The queriable log message is too long and will be truncated to "); stb.append(MAX_MESSAGE_LENGTH); stb.append(" characters. The original message is '"); stb.append(rawMessage); stb.append("'. It will be truncated to '"); stb.append(truncatedMessage); stb.append("'"); logger.log(getClass(), TechnicalLogSeverity.INFO, stb.toString()); } } return builder.callerClassName(callerClassName).callerMethodName(callerMethodName) .userId(sessionProvider.getUserId()).clusterNode(sessionProvider.getClusterNode()) .productVersion(platformService.getSPlatformProperties().getPlatformVersion()) .done(); }
@Override public Boolean call() throws SBonitaException { // the database version platform = platformService.getPlatform(); final String dbVersion = platform.getVersion(); // the version in jars platformProperties = platformService.getSPlatformProperties(); final String jarVersion = platformProperties.getPlatformVersion(); // the version in bonita home final String platformMinorVersion = format(dbVersion); final String propertiesMinorVersion = format(jarVersion); boolean same = platformMinorVersion.equals(propertiesMinorVersion); if (!same) { errorMessage = "The version of the platform in database is not the same as expected: bonita-server version is <" + jarVersion + "> and database version is <" + dbVersion + ">"; } return same; }
@Override public Boolean call() throws SBonitaException { // the database version platform = platformService.getPlatform(); final String dbVersion = platform.getVersion(); // the version in jars platformProperties = platformService.getSPlatformProperties(); final String jarVersion = platformProperties.getPlatformVersion(); // the version in bonita home final String platformMinorVersion = format(dbVersion); final String propertiesMinorVersion = format(jarVersion); boolean same = platformMinorVersion.equals(propertiesMinorVersion); if (!same) { errorMessage = "The version of the platform in database is not the same as expected: bonita-server version is <" + jarVersion + "> and database version is <" + dbVersion + ">"; } return same; }