Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 78358 invoked from network); 5 May 2009 17:49:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 May 2009 17:49:26 -0000 Received: (qmail 61284 invoked by uid 500); 5 May 2009 17:49:26 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 61252 invoked by uid 500); 5 May 2009 17:49:26 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 61241 invoked by uid 99); 5 May 2009 17:49:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 17:49:26 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 17:49:16 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M1OlC-0000BJ-6x for log4j-user@logging.apache.org; Tue, 05 May 2009 10:48:54 -0700 Message-ID: <23392539.post@talk.nabble.com> Date: Tue, 5 May 2009 10:48:54 -0700 (PDT) From: Marc Farrow To: log4j-user@logging.apache.org Subject: RE: DailyRollingAppender - How does it know when to rollover? In-Reply-To: <23392469.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9230_29706254.1241545734211" X-Nabble-From: marc.farrow@gmail.com References: <23390773.post@talk.nabble.com> <44B76DF56DE7A843BB5E8109DC4EEB1204D5BE7DDE@sbapexch05> <23392469.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9230_29706254.1241545734211 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Also, to give further information. In Java, you cannot read the "created" date on a file as only certain operating systems understand it (namely, OpenVMS and Windows). So, how does the logging engine know when to roll over? Is it looking inside the log file for date patterns? Here a sample of my logging file. INFO 2009-Apr-10 07:57:49.976 - USERNAME published pdfFile.pdf from C:/webstatic/source/ to TMP0. INFO 2009-Apr-10 07:57:49.979 - USERNAME published pdfFile2.pdf from C:/webstatic/source/ to TMP0. INFO 2009-Apr-10 08:05:30.848 - USERNAME published pdfFile.pdf from C:/webstatic/source/ to TMP0. INFO 2009-Apr-10 08:05:30.851 - USERNAME published pdfFile2.pdf from C:/webstatic/source/ to TMP0. INFO 2009-Apr-10 09:32:16.503 - USERNAME published pdfFile.pdf from C:/webstatic/source/ to TMP0. INFO 2009-Apr-10 09:32:16.504 - USERNAME published pdfFile2.pdf from C:/webstatic/source/ to TMP0. INFO 2009-May-05 10:53:35.722 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 10:53:35.723 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 11:39:05.754 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 11:39:05.755 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 11:43:35.942 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 11:43:35.942 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 11:45:10.191 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 11:45:10.191 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 13:13:38.857 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 13:13:38.858 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 13:14:26.627 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 13:14:26.627 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 13:15:08.601 - USERNAME published pdfFile.pdf from c:/webstatic/source to TMP0. INFO 2009-May-05 13:15:08.602 - USERNAME published pdfFile2.pdf from c:/webstatic/source to TMP0. Marc Farrow wrote: > > Yes, this is what I am wanting. > > The original log file was created in April and now when items are written > to file the log file still has not been rolled over. > > Since the application is writing to the specified log file, then wouldn't > that mean that these properties posted would be the ones being used? > > Thanks. > > > Matt Brown-20 wrote: >> >> The date pattern that you have: >> >> log4j.appender.R.DatePattern='.'yyyy-MM >> >> >> Will only roll the files over on a monthly basis. Just want to be sure >> that this is what you intend? >> >> If this is the intended behavior, I'd check to make sure that a different >> log4j configuration file isn't being loaded from somewhere in the OpenVMS >> environment. You can enable the -Dlog4j.debug system property to be able >> to see which config file log4j is using. >> >> -----Original Message----- >> From: Marc.Farrow [mailto:marc.farrow@gmail.com] >> Sent: Tuesday, May 05, 2009 12:14 PM >> To: log4j-user@logging.apache.org >> Subject: DailyRollingAppender - How does it know when to rollover? >> >> >> 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. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> For additional commands, e-mail: log4j-user-help@logging.apache.org >> >> >> > > -- View this message in context: http://www.nabble.com/DailyRollingAppender---How-does-it-know-when-to-rollover--tp23390773p23392539.html Sent from the Log4j - Users mailing list archive at Nabble.com. ------=_Part_9230_29706254.1241545734211--