private static void prepareSyslogAppenderConfiguration(StringBuilder sb, SyslogAppenderConfigurationType appender, LoggingConfigurationType config) { prepareCommonAppenderHeader(sb, appender, config, "ch.qos.logback.classic.net.SyslogAppender"); appendProp(sb, "syslogHost", appender.getSyslogHost()); appendProp(sb, "port", appender.getPort()); appendProp(sb, "facility", appender.getFacility()); appendProp(sb, "suffixPattern", appender.getSuffixPattern()); appendProp(sb, "stackTracePattern", appender.getStackTracePattern()); appendProp(sb, "throwableExcluded", appender.isThrowableExcluded()); prepareCommonAppenderFooter(sb, appender); }
@SuppressWarnings("unused") private void fakeMethod() { LoggingConfigurationManager.dummy(); }
private static void prepareAppenderConfiguration(StringBuilder sb, AppenderConfigurationType appender, LoggingConfigurationType config, boolean createAltForThisAppender, MidpointConfiguration midpointConfiguration) throws SchemaException { if (appender instanceof FileAppenderConfigurationType) { prepareFileAppenderConfiguration(sb, (FileAppenderConfigurationType) appender, config); } else if (appender instanceof SyslogAppenderConfigurationType) { prepareSyslogAppenderConfiguration(sb, (SyslogAppenderConfigurationType) appender, config); } else { throw new SchemaException("Unknown appender configuration "+appender); } if (createAltForThisAppender) { prepareAltAppenderConfiguration(sb, appender, midpointConfiguration); } }
defineTurbo(sb, ss); continue; defineTurbo(sb, ss); boolean altAppenderEnabled = isAltAppenderEnabled(midpointConfiguration); boolean altAppenderCreated = false; prepareAppenderConfiguration(sb, appender, config, createAlt, midpointConfiguration); altAppenderCreated = altAppenderCreated || createAlt; generateAuditingLogConfig(config.getAuditing(), sb);
private static void prepareAltAppenderConfiguration(StringBuilder sb, AppenderConfigurationType appender, MidpointConfiguration midpointConfiguration) { String altFilename = getAltAppenderFilename(midpointConfiguration); String altPrefix = getAltAppenderPrefix(midpointConfiguration); if (StringUtils.isNotEmpty(altFilename)) { sb.append("<appender name=\"" + ALT_APPENDER_NAME + "\" class=\"ch.qos.logback.core.FileAppender\">\n") .append("\t\t\t\t<file>").append(altFilename).append("</file>\n") .append("\t\t\t\t<layout class=\"ch.qos.logback.classic.PatternLayout\">\n") .append("\t\t\t\t\t<pattern>").append(altPrefix).append(appender.getPattern()).append("</pattern>\n") .append("\t\t\t\t</layout>\n") .append("\t\t\t</appender>"); } else { sb.append("<appender name=\"" + ALT_APPENDER_NAME + "\" class=\"ch.qos.logback.core.ConsoleAppender\">\n") .append("\t\t\t\t<layout class=\"ch.qos.logback.classic.PatternLayout\">\n") .append("\t\t\t\t\t<pattern>").append(altPrefix).append(appender.getPattern()).append("</pattern>\n") .append("\t\t\t\t</layout>\n") .append("\t\t\t</appender>"); } }
private static void prepareCommonAppenderHeader(StringBuilder sb, AppenderConfigurationType appender, LoggingConfigurationType config, String appenderClass) { sb.append("\t<appender name=\"").append(appender.getName()).append("\" class=\"").append(appenderClass).append("\">\n"); //Apply profiling appender filter if necessary if(IDM_PROFILE_APPENDER.equals(appender.getName())){ for(ClassLoggerConfigurationType cs: config.getClassLogger()){ if(REQUEST_FILTER_LOGGER_CLASS_NAME.equals(cs.getPackage()) || PROFILING_ASPECT_LOGGER.endsWith(cs.getPackage())){ LOGGER.debug("Defining ProfilingLogbackFilter to {} appender.", appender.getName()); sb.append(defineProfilingLogbackFilter()); } } } }
private void applyLoggingConfiguration(PrismObject<SystemConfigurationType> configuration, OperationResult result) { try { LoggingConfigurationType loggingWithProfiling = ProfilingConfigurationManager .checkSystemProfilingConfiguration(configuration); if (loggingWithProfiling != null) { LoggingConfigurationManager.configure(loggingWithProfiling, configuration.getVersion(), midpointConfiguration, result); } } catch (Throwable t) { LoggingUtils.logUnexpectedException(LOGGER, "Couldn't apply logging configuration", t); lastVersionApplied = null; } }
prepareCommonAppenderHeader(sb, appender, config, appenderClass); appendProp(sb, "file", fileName); appendProp(sb, "append", isAppend); } else { appendProp(sb, "prudent", true); prepareCommonAppenderFooter(sb, appender);