logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc.Farrow" <marc.far...@gmail.com>
Subject DailyRollingAppender - How does it know when to rollover?
Date Tue, 05 May 2009 16:14:22 GMT

I am trying to use LOG4J on OpenVMS.  However, my logger is not rolling over
on OpenVMS.  So I want to know how the code is determining when the log file
should be rolled over.  Below I am posting my code and properties file.  The
same code works on windows (of course, I have different properties file that
loads on windows).  For completeness sake, I am posting both properties
files.


package com.name.webpublishing.webpublishing;
public class WebPublishingApp {
    public static Logger logger = getLogger();
    private static Logger getLogger() {
        try {
            String osName =
System.getProperty("os.name").toLowerCase().equals("openvms") ? "openvms" :
"windows";
            InputStream is =
WebPublishingApp.class.getClassLoader().getResourceAsStream("/com/name/webpublishing/webpublishing/log4j_"
+ osName + ".properties");
            Properties props = new Properties();
            props.load(is);
            PropertyConfigurator.configure(props);
            System.out.println("LOADED PROPERTIES!!!");
        } catch (IOException ignored) {
            if (SeflWebPublishingServlet.DEBUG) {
                ignored.printStackTrace();
            }
            // just use default
        }
        return Logger.getLogger(WebPublishingApp.class);
    }
}

openvms properties - log4j_openvms.properties
log4j.rootLogger=WARN, R
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=LOG0:WebPublishing.log
log4j.appender.R.DatePattern='.'yyyy-MM
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %d{yyyy-MMM-dd HH:mm:ss.SSS} -
%m%n
log4j.appender.R.ImmediateFlush=true
log4j.logger.com.sefl.webpublishing=DEBUG

windows properties - log4j_windows.properties
log4j.rootLogger=WARN, R
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=C:/WebStatic/webtmp/WebPublishing.log
log4j.appender.R.DatePattern='.'yyyy-MM
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %d{yyyy-MMM-dd HH:mm:ss.SSS} -
%m%n
log4j.appender.R.ImmediateFlush=true
log4j.logger.com.sefl.webpublishing=DEBUG
-- 
View this message in context: http://www.nabble.com/DailyRollingAppender---How-does-it-know-when-to-rollover--tp23390773p23390773.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message