West100
asked on
How to use log4j with appending more log messages
How should a log4j properties file be configured so that messages won't be appended for each run to the same log file? Currently weeks worth of logged messages have been rolled into the same log file making it huge and difficult to work with. I want to have a fresh log file containing only the current runs logged messages. I don't want separate logs for each run. One log is enough containing one runs worth of messages at a time.
I am currently using the following log4j.properties file configurations:
log4j.rootLogger = INFO, F
log4j.appender.F=org.apach e.log4j.Fi leAppender
log4j.appender.F.File=/usr /local/adm in/logs/QA SBulk.log
log4j.appender.F.layout=or g.apache.l og4j.Patte rnLayout
log4j.appender.F.layout.Co nversionPa ttern=[%d{ MMM dd HH:mm:ss}] (%-5p) - %m - at (%F:%L)%n
Thanks
I am currently using the following log4j.properties file configurations:
log4j.rootLogger = INFO, F
log4j.appender.F=org.apach
log4j.appender.F.File=/usr
log4j.appender.F.layout=or
log4j.appender.F.layout.Co
Thanks
ASKER
No that does not work
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also have a look on RollingFileAppender and DailyRollingFileAppender
http://veerasundar.com/blog/2009/07/log4j-tutorial-how-to-send-the-log-messages-to-a-file/
http://veerasundar.com/blog/2009/07/log4j-tutorial-how-to-send-the-log-messages-to-a-file/
:)
log4j.appender.F.fileAppen