logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <asgeir.nil...@telenor.com>
Subject RE: Log4J problem with RollingFileAppender and backups
Date Wed, 29 Sep 2004 14:16:37 GMT
My recommendation is that you use the basic WriterAppender / FileAppender, and handle the rolling
outside the application.

One solution (which we use) could be to embed a date in the file name, and have the appender
restart at regular intervals.

</asgeir>


> -----Original Message-----
> From: Järkeborn Joacim [mailto:joacim.jarkeborn@volvo.com]
> Sent: Wednesday, September 29, 2004 4:01 PM
> To: log4j-dev@logging.apache.org
> Subject: FW: Log4J problem with RollingFileAppender and backups
> 
> 
> 
> Hi,
> 
> We are getting quite desperate about our disappearing 
> logfiles and I therefore post this issue to the log4j-developer list.
> 
> Can you help me?
> 
> 
> Regards
> Joacim Järkeborn
> IT Architect
> 
> > -----Original Message-----
> > From: Järkeborn Joacim [mailto:joacim.jarkeborn@volvo.com] 
> > Sent: den 29 september 2004 14:10
> > To: Log4J Users List
> > Subject: RE: Log4J problem with RollingFileAppender and backups
> > 
> > Hi again,
> > Doesn't anyone else having this problem? 
> > Anyone having some solution of this? 
> > 
> > OS: Windows 2000/XP
> > 
> > Regards
> > Joacim Järkeborn
> > IT Architect
> > 
> >  
> > 
> > > -----Original Message-----
> > > From: Järkeborn Joacim [mailto:joacim.jarkeborn@volvo.com]
> > > Sent: den 28 september 2004 12:21
> > > To: Log4J Users List
> > > Subject: RE: Log4J problem with RollingFileAppender and backups
> > > 
> > > 
> > > Some additional notes...
> > > 
> > > The renaming of "mylog.log.x" --> "mylog.log.x+1" works but NOT 
> > > "mylog.log" --> "mylog.log.1". Therefore the backups rolls 
> > away after 
> > > some rolling.
> > > 
> > > 
> > > 
> > > Regards
> > > Joacim Järkeborn
> > > IT Architect
> > > 
> > >  
> > > 
> > > > -----Original Message-----
> > > > From: Järkeborn Joacim [mailto:joacim.jarkeborn@volvo.com]
> > > > Sent: den 28 september 2004 09:48
> > > > To: log4j-user@logging.apache.org
> > > > Subject: Log4J problem with RollingFileAppender and backups
> > > > 
> > > > Hi,
> > > > 
> > > > 
> > > > We are using Log4J in our J2EE application with 
> > RollingFileAppender 
> > > > and a number of backups.
> > > > 
> > > > When the appserver and application starts everything seems
> > > to work as
> > > > it should, it creates the logfile and backups after the max
> > > file size
> > > > have been reached. When max backup parameters are reached 
> > the files 
> > > > rolls away from disk.
> > > > 
> > > > But when restarting the application (ear, not the
> > > appserver) it seems
> > > > to lost it's track and the the files are removed one by
> > > one, starting
> > > > with the logfile.log.1.
> > > > 
> > > > The logfiles can not be removed as long as the appserver is
> > > started. 
> > > > 
> > > > Any ideas? 
> > > > 
> > > > Using IBM WebSphere 5.0.2/5.1 and Log4J 1.2.8. 
> > > > Configuration and trace are avialable below. 
> > > > 
> > > > BR
> > > > Joacim J
> > > > 
> > > > --------------------------------------------------------------
> > > > ------------
> > > > log4j config
> > > > --------------------------------------------------------------
> > > > ------------
> > > > <log4j:configuration> 
> > > >     <appender name="A_ROOT" 
> > > > class="org.apache.log4j.RollingFileAppender"> 
> > > >         <param name="File" value="logs/pos.log"/> 
> > > >         <param name="Append" value="True"/>
> > > > 
> > > >         <!-- Set the maximum log file size --> 
> > > >         <param name="MaxFileSize" value="64KB"/>
> > > > 
> > > >         <!-- Keep two backups of the log --> 
> > > >         <param name="MaxBackupIndex" value="20"/>
> > > > 
> > > >         <!-- The log layout --> 
> > > >         <layout class="org.apache.log4j.PatternLayout"> 
> > > >             <param name="ConversionPattern" value="%d 
> > %-5p %-30c{1} 
> > > > [%x] %m%n"/>
> > > >         </layout> 
> > > >     </appender>
> > > > 
> > > >     <appender name="STDOUT" 
> > > class="org.apache.log4j.ConsoleAppender">
> > > >         <param name="File" value="System.out"/> 
> > > >         <layout class="org.apache.log4j.PatternLayout"> 
> > > >             <param name="ConversionPattern" value="%d %-5p
> > > [%t] %C{2}
> > > > (%F:%L) - %m\n"/>
> > > >         </layout> 
> > > >     </appender>
> > > > 
> > > >     <category name="org.apache.log4j.xml"> 
> > > >         <priority value="info"/> 
> > > >         <appender-ref ref="A_ROOT"/> 
> > > >     </category>
> > > > 
> > > >     <root> 
> > > >         <priority value="debug"/> 
> > > >         <appender-ref ref="A_ROOT"/> 
> > > >     </root>
> > > > </log4j:configuration>
> > > > 
> > > > 
> > > > 
> > > > --------------------------------------------------------------
> > > > ------------
> > > > The Log4J trace: 
> > > > --------------------------------------------------------------
> > > > ------------
> > > > log4j: Standard DocumentBuilderFactory search succeded. 
> > > > log4j: DocumentBuilderFactory is: 
> > > > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> > > > log4j: debug attribute= "null". 
> > > > log4j: Ignoring debug attribute. 
> > > > log4j: Threshold ="null". 
> > > > log4j: Retreiving an instance of org.apache.log4j.Logger. 
> > > > log4j: Setting [org.apache.log4j.xml] additivity to [true]. 
> > > > log4j: Level value for org.apache.log4j.xml is  [info]. 
> > > > log4j: org.apache.log4j.xml level set to INFO
> > > > log4j: Class name: [org.apache.log4j.RollingFileAppender]
> > > > log4j: Setting property [file] to [logs/pos.log]. 
> > > > log4j: Setting property [append] to [true]. 
> > > > log4j: Setting property [maxFileSize] to [64KB]. 
> > > > log4j: Setting property [maxBackupIndex] to [20]. 
> > > > log4j: Parsing layout of class: 
> "org.apache.log4j.PatternLayout" 
> > > > log4j: Setting property [conversionPattern] to [%d %-5p
> > > %-30c{1} [%x]
> > > > %m%n].
> > > > log4j: setFile called: logs/pos.log, true
> > > > log4j: setFile ended
> > > > log4j: Adding appender named [A_ROOT] to category 
> > > > [org.apache.log4j.xml].
> > > > log4j: Level value for root is  [debug]. 
> > > > log4j: root level set to DEBUG
> > > > log4j: Adding appender named [A_ROOT] to category [root]. 
> > > > 
> > > > ... 
> > > > 
> > > > log4j: rolling over count=65682
> > > > log4j: maxBackupIndex=20
> > > > log4j: Renaming file logs\pos.log.19 to logs\pos.log.20
> > > > log4j: Renaming file logs\pos.log.18 to logs\pos.log.19
> > > > log4j: Renaming file logs\pos.log.17 to logs\pos.log.18
> > > > log4j: Renaming file logs\pos.log.16 to logs\pos.log.17
> > > > log4j: Renaming file logs\pos.log.15 to logs\pos.log.16
> > > > log4j: Renaming file logs\pos.log.14 to logs\pos.log.15
> > > > log4j: Renaming file logs\pos.log.13 to logs\pos.log.14
> > > > log4j: Renaming file logs\pos.log.12 to logs\pos.log.13
> > > > log4j: Renaming file logs\pos.log.11 to logs\pos.log.12
> > > > log4j: Renaming file logs\pos.log.10 to logs\pos.log.11
> > > > log4j: Renaming file logs\pos.log.9 to logs\pos.log.10
> > > > log4j: Renaming file logs\pos.log.8 to logs\pos.log.9
> > > > log4j: Renaming file logs\pos.log.7 to logs\pos.log.8
> > > > log4j: Renaming file logs\pos.log.6 to logs\pos.log.7
> > > > log4j: Renaming file logs\pos.log.5 to logs\pos.log.6
> > > > log4j: Renaming file logs\pos.log.4 to logs\pos.log.5
> > > > log4j: Renaming file logs\pos.log.3 to logs\pos.log.4
> > > > log4j: Renaming file logs\pos.log.2 to logs\pos.log.3
> > > > log4j: Renaming file logs\pos.log.1 to logs\pos.log.2
> > > > log4j: Renaming file logs\pos.log to logs\pos.log.1
> > > > log4j: setFile called: logs/pos.log, false
> > > > log4j: setFile ended
> > > > 
> > > > ... [EAR RESTART]
> > > > 
> > > > log4j: Standard DocumentBuilderFactory search succeded. 
> > > > log4j: DocumentBuilderFactory is: 
> > > > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> > > > log4j: debug attribute= "null". 
> > > > log4j: Ignoring debug attribute. 
> > > > log4j: Threshold ="null". 
> > > > log4j: Retreiving an instance of org.apache.log4j.Logger. 
> > > > log4j: Setting [org.apache.log4j.xml] additivity to [true]. 
> > > > log4j: Level value for org.apache.log4j.xml is  [info]. 
> > > > log4j: org.apache.log4j.xml level set to INFO
> > > > log4j: Class name: [org.apache.log4j.RollingFileAppender]
> > > > log4j: Setting property [file] to [logs/pos.log]. 
> > > > log4j: Setting property [append] to [true]. 
> > > > log4j: Setting property [maxFileSize] to [64KB]. 
> > > > log4j: Setting property [maxBackupIndex] to [20]. 
> > > > log4j: Parsing layout of class: 
> "org.apache.log4j.PatternLayout" 
> > > > log4j: Setting property [conversionPattern] to [%d %-5p
> > > %-30c{1} [%x]
> > > > %m%n].
> > > > log4j: setFile called: logs/pos.log, true
> > > > log4j: setFile ended
> > > > log4j: Adding appender named [A_ROOT] to category 
> > > > [org.apache.log4j.xml].
> > > > log4j: Level value for root is  [debug]. 
> > > > log4j: root level set to DEBUG
> > > > log4j: Adding appender named [A_ROOT] to category [root]. 
> > > > 
> > > > ... [RUNNING APPLICATION TO GENERATE LOGS/ROLLING FILES]
> > > > 
> > > > log4j: rolling over count=65663
> > > > log4j: maxBackupIndex=20
> > > > log4j: Renaming file logs\pos.log.19 to logs\pos.log.20
> > > > log4j: Renaming file logs\pos.log.18 to logs\pos.log.19
> > > > log4j: Renaming file logs\pos.log.17 to logs\pos.log.18
> > > > log4j: Renaming file logs\pos.log.16 to logs\pos.log.17
> > > > log4j: Renaming file logs\pos.log.15 to logs\pos.log.16
> > > > log4j: Renaming file logs\pos.log.14 to logs\pos.log.15
> > > > log4j: Renaming file logs\pos.log.13 to logs\pos.log.14
> > > > log4j: Renaming file logs\pos.log.12 to logs\pos.log.13
> > > > log4j: Renaming file logs\pos.log.11 to logs\pos.log.12
> > > > log4j: Renaming file logs\pos.log.10 to logs\pos.log.11
> > > > log4j: Renaming file logs\pos.log.9 to logs\pos.log.10
> > > > log4j: Renaming file logs\pos.log.8 to logs\pos.log.9
> > > > log4j: Renaming file logs\pos.log.7 to logs\pos.log.8
> > > > log4j: Renaming file logs\pos.log.6 to logs\pos.log.7
> > > > log4j: Renaming file logs\pos.log.5 to logs\pos.log.6
> > > > log4j: Renaming file logs\pos.log.4 to logs\pos.log.5
> > > > log4j: Renaming file logs\pos.log.3 to logs\pos.log.4
> > > > log4j: Renaming file logs\pos.log.2 to logs\pos.log.3
> > > > log4j: Renaming file logs\pos.log.1 to logs\pos.log.2
> > > > log4j: Renaming file logs\pos.log to logs\pos.log.1
> > > > log4j: setFile called: logs/pos.log, false
> > > > log4j: setFile ended
> > > > 
> > > > ... [FILES STARTS TO DISAPPEAR]
> > > > 
> > > > log4j: rolling over count=65655
> > > > log4j: maxBackupIndex=20
> > > > log4j: Renaming file logs\pos.log.19 to logs\pos.log.20
> > > > log4j: Renaming file logs\pos.log.18 to logs\pos.log.19
> > > > log4j: Renaming file logs\pos.log.17 to logs\pos.log.18
> > > > log4j: Renaming file logs\pos.log.16 to logs\pos.log.17
> > > > log4j: Renaming file logs\pos.log.15 to logs\pos.log.16
> > > > log4j: Renaming file logs\pos.log.14 to logs\pos.log.15
> > > > log4j: Renaming file logs\pos.log.13 to logs\pos.log.14
> > > > log4j: Renaming file logs\pos.log.12 to logs\pos.log.13
> > > > log4j: Renaming file logs\pos.log.11 to logs\pos.log.12
> > > > log4j: Renaming file logs\pos.log.10 to logs\pos.log.11
> > > > log4j: Renaming file logs\pos.log.9 to logs\pos.log.10
> > > > log4j: Renaming file logs\pos.log.8 to logs\pos.log.9
> > > > log4j: Renaming file logs\pos.log.7 to logs\pos.log.8
> > > > log4j: Renaming file logs\pos.log.6 to logs\pos.log.7
> > > > log4j: Renaming file logs\pos.log.5 to logs\pos.log.6
> > > > log4j: Renaming file logs\pos.log.4 to logs\pos.log.5
> > > > log4j: Renaming file logs\pos.log.3 to logs\pos.log.4
> > > > log4j: Renaming file logs\pos.log.2 to logs\pos.log.3
> > > > log4j: Renaming file logs\pos.log to logs\pos.log.1
> > > > log4j: setFile called: logs/pos.log, false
> > > > log4j: setFile ended
> > > > 
> > > > ... 
> > > > 
> > > > log4j: rolling over count=65582
> > > > log4j: maxBackupIndex=20
> > > > log4j: Renaming file logs\pos.log.19 to logs\pos.log.20
> > > > log4j: Renaming file logs\pos.log.18 to logs\pos.log.19
> > > > log4j: Renaming file logs\pos.log.17 to logs\pos.log.18
> > > > log4j: Renaming file logs\pos.log.16 to logs\pos.log.17
> > > > log4j: Renaming file logs\pos.log.15 to logs\pos.log.16
> > > > log4j: Renaming file logs\pos.log.14 to logs\pos.log.15
> > > > log4j: Renaming file logs\pos.log.13 to logs\pos.log.14
> > > > log4j: Renaming file logs\pos.log.12 to logs\pos.log.13
> > > > log4j: Renaming file logs\pos.log.11 to logs\pos.log.12
> > > > log4j: Renaming file logs\pos.log.10 to logs\pos.log.11
> > > > log4j: Renaming file logs\pos.log.9 to logs\pos.log.10
> > > > log4j: Renaming file logs\pos.log.8 to logs\pos.log.9
> > > > log4j: Renaming file logs\pos.log.7 to logs\pos.log.8
> > > > log4j: Renaming file logs\pos.log.6 to logs\pos.log.7
> > > > log4j: Renaming file logs\pos.log.5 to logs\pos.log.6
> > > > log4j: Renaming file logs\pos.log.4 to logs\pos.log.5
> > > > log4j: Renaming file logs\pos.log.3 to logs\pos.log.4
> > > > log4j: Renaming file logs\pos.log to logs\pos.log.1
> > > > log4j: setFile called: logs/pos.log, false
> > > > log4j: setFile ended
> > > > 
> > > > ... 
> > > > 
> > > > log4j: rolling over count=65682
> > > > log4j: maxBackupIndex=20
> > > > log4j: Renaming file logs\pos.log.19 to logs\pos.log.20
> > > > log4j: Renaming file logs\pos.log.18 to logs\pos.log.19
> > > > log4j: Renaming file logs\pos.log.17 to logs\pos.log.18
> > > > log4j: Renaming file logs\pos.log.16 to logs\pos.log.17
> > > > log4j: Renaming file logs\pos.log.15 to logs\pos.log.16
> > > > log4j: Renaming file logs\pos.log.14 to logs\pos.log.15
> > > > log4j: Renaming file logs\pos.log.13 to logs\pos.log.14
> > > > log4j: Renaming file logs\pos.log.12 to logs\pos.log.13
> > > > log4j: Renaming file logs\pos.log.11 to logs\pos.log.12
> > > > log4j: Renaming file logs\pos.log.10 to logs\pos.log.11
> > > > log4j: Renaming file logs\pos.log.9 to logs\pos.log.10
> > > > log4j: Renaming file logs\pos.log.8 to logs\pos.log.9
> > > > log4j: Renaming file logs\pos.log.7 to logs\pos.log.8
> > > > log4j: Renaming file logs\pos.log.6 to logs\pos.log.7
> > > > log4j: Renaming file logs\pos.log.5 to logs\pos.log.6
> > > > log4j: Renaming file logs\pos.log.4 to logs\pos.log.5
> > > > log4j: Renaming file logs\pos.log to logs\pos.log.1
> > > > log4j: setFile called: logs/pos.log, false
> > > > log4j: setFile ended
> > > > 
> > > >  
> > > > Regards
> > > > Joacim Järkeborn
> > > > IT Architect
> > > > 
> > > >  
> > > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: 
> log4j-user-help@logging.apache.org
> > > 
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message