Search in sources :

Example 1 with JacORBFilter

use of alma.acs.logging.adapters.JacORBFilter in project ACS by ACS-Community.

the class JacorbLoggerHelper method getLogger.

/**
	 * @see ACSLoggerFactory#getLogger(String)
	 */
public Logger getLogger(String name) {
    if (jdkAdapter == null) {
        // reuse one acs logger for all jacorb loggers
        AcsLogger acsLoggerDelegate = ClientLogManager.getAcsLogManager().getLoggerForCorba(JACORB_LOGGER_NAME, true);
        acsLoggerDelegate.addLoggerClass(JDK14LoggerAdapter.class);
        JacORBFilter logFilter = new JacORBFilter();
        // AcsLogger will later update the filter log level if there are changes
        logFilter.setLogLevel(acsLoggerDelegate.getLevel());
        acsLoggerDelegate.setFilter(logFilter);
        jdkAdapter = new JDK14LoggerAdapter(acsLoggerDelegate);
    }
    return jdkAdapter;
}
Also used : JacORBFilter(alma.acs.logging.adapters.JacORBFilter) AcsLogger(alma.acs.logging.AcsLogger)

Example 2 with JacORBFilter

use of alma.acs.logging.adapters.JacORBFilter in project ACS by ACS-Community.

the class AcsLogger method configureLogging.

/**
     * Callback method, configures this logger from the data in logConfig.
     * @see alma.acs.logging.config.LogConfigSubscriber#configureLogging(alma.acs.logging.config.LogConfig)
     */
public void configureLogging(LogConfig newLogConfig) {
    if (newLogConfig == null) {
        throw new IllegalArgumentException("newLogConfig must not be null");
    }
    logConfig = newLogConfig;
    try {
        UnnamedLogger config = logConfig.getNamedLoggerConfig(getLoggerName());
        if (DEBUG) {
            System.out.println("*** AcsLogger#configureLogging: name=" + getLoggerName() + " minLevel=" + config.getMinLogLevel() + " minLevelLocal=" + config.getMinLogLevelLocal());
        }
        configureLevels(config);
    } catch (Exception e) {
        log(Level.INFO, "Failed to configure logger.", e);
    }
    // forward log level to optional JacORB filter
    // Perhaps this dependency is too dirty, then we need a more general
    // filter registration mechanism parallel to what the JDK foresees.
    Filter logFilter = getFilter();
    if (logFilter != null && logFilter instanceof JacORBFilter) {
        ((JacORBFilter) logFilter).setLogLevel(getLevel());
    }
}
Also used : UnnamedLogger(alma.maci.loggingconfig.UnnamedLogger) JacORBFilter(alma.acs.logging.adapters.JacORBFilter) Filter(java.util.logging.Filter) JacORBFilter(alma.acs.logging.adapters.JacORBFilter)

Aggregations

JacORBFilter (alma.acs.logging.adapters.JacORBFilter)2 AcsLogger (alma.acs.logging.AcsLogger)1 UnnamedLogger (alma.maci.loggingconfig.UnnamedLogger)1 Filter (java.util.logging.Filter)1