use of org.apache.commons.logging.impl.Jdk14Logger in project ACS by ACS-Community.
the class CommonsLoggingFactory method newInstance.
@Override
protected synchronized Log newInstance(String name) throws LogConfigurationException {
// System.out.println("CommonsLoggingFactoryForACS#newInstance called for name=" + name);
// Check which framework is requesting the apache commons logger
String loggerNameBase = null;
StackTraceElement[] stackTrace = (new Exception()).getStackTrace();
for (StackTraceElement stackTraceElement : stackTrace) {
if (stackTraceElement.getClassName().contains("org.apache.commons.scxml")) {
loggerNameBase = SCXML_LOGGER_NAME_PREFIX;
break;
}
// TODO: add check for other frameworks that use apache logging commons, once we have those
}
// Give up if we did not recognize the client framework
if (loggerNameBase == null) {
return super.newInstance(name);
}
// Check if we already have a logger for the client framework, and create it if needed.
Log myLog = loggerMap.get(loggerNameBase);
if (myLog == null) {
final String loggerNameBaseFinal = loggerNameBase;
myLog = new Jdk14Logger(loggerNameBase) {
@Override
public Logger getLogger() {
// to some known framework loggers, in the absence of other specific log configuration.
return ClientLogManager.getAcsLogManager().getLoggerForCorba(loggerNameBaseFinal, true);
}
};
loggerMap.put(loggerNameBase, myLog);
}
return myLog;
}
use of org.apache.commons.logging.impl.Jdk14Logger in project spring-boot by spring-projects.
the class JavaLoggingSystemTests method init.
@Before
public void init() throws SecurityException, IOException {
this.defaultLocale = Locale.getDefault();
Locale.setDefault(Locale.ENGLISH);
this.logger = new Jdk14Logger(getClass().getName());
}
Aggregations