Commit 1a6057c4 authored by Landry Breuil's avatar Landry Breuil Committed by Andrea Aime
Browse files

[GEOS-7213] Check geoserverlogfile appender against FileAppender

This allows to use a DailyRollingFileAppender.
parent f0e2ba28
......@@ -78,7 +78,7 @@ public class LoggingUtils {
// configuring the log4j file logger
if(!suppressFileLogging) {
Appender gslf = org.apache.log4j.Logger.getRootLogger().getAppender("geoserverlogfile");
if (gslf instanceof org.apache.log4j.RollingFileAppender) {
if (gslf instanceof org.apache.log4j.FileAppender) {
if (logFileName == null ) {
logFileName = new File(loader.findOrCreateDirectory("logs"), "geoserver.log").getAbsolutePath();
} else {
......@@ -91,7 +91,7 @@ public class LoggingUtils {
PropertyConfigurator.configure(lprops);
LoggingInitializer.LOGGER.fine("Logging output to file '" + logFileName + "'");
} else if (gslf != null) {
LoggingInitializer.LOGGER.warning("'log4j.appender.geoserverlogfile' appender is defined, but isn't a RollingFileAppender. GeoServer won't control the file-based logging.");
LoggingInitializer.LOGGER.warning("'log4j.appender.geoserverlogfile' appender is defined, but isn't a FileAppender. GeoServer won't control the file-based logging.");
} else {
LoggingInitializer.LOGGER.warning("'log4j.appender.geoserverlogfile' appender isn't defined. GeoServer won't control the file-based logging.");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment