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;
}
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());
}
}
Aggregations