if(Boolean.valueOf(relinquishLoggingControl)) {
getLogger().info("RELINQUISH_LOG4J_CONTROL on, won't attempt to reconfigure LOG4J loggers");
} else {
try {
File baseDir = new File(GeoserverDataDirectory.findGeoServerDataDir(context));
GeoServerResourceLoader loader = new GeoServerResourceLoader(baseDir);
File f= loader.find( "logging.xml" );
if ( f != null ) {
XStreamPersister xp = new XStreamPersisterFactory().createXMLPersister();
BufferedInputStream in = new BufferedInputStream( new FileInputStream( f ) );
try {
LoggingInfo loginfo = xp.load(in,LoggingInfo.class);
final String location = getLogFileLocation(loginfo.getLocation());
LoggingUtils.initLogging(loader, loginfo.getLevel(), !loginfo.isStdOutLogging(),
location);
}
finally {
in.close();
}
}
else {
//check for old style data directory
f = loader.find( "services.xml" );
if ( f != null ) {
LegacyLoggingImporter loggingImporter = new LegacyLoggingImporter();
loggingImporter.imprt(baseDir);
final String location = getLogFileLocation(loggingImporter.getLogFile());
LoggingUtils.initLogging(loader, loggingImporter.getConfigFileName(), loggingImporter