0

I have this Log4j.properties with me

log4j.rootCategory=Info, A1

# A1 is a DailyRollingFileAppender

log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.file=${user.home}/MYWEB/MYWEB.log
log4j.appender.A1.datePattern='.'yyyy-MM-dd
log4j.appender.A1.append=true
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-22d{dd/MMM/yyyy HH:mm:ss} - %m%n

My question is that , the Log file MYWEB.log is not able to hold more data , means if more requests are made to the application , the Previous logs are being lost .

Please tell me how to make the Log file hold any amount of daat for that day .

Pawan
  • 31,545
  • 102
  • 256
  • 434

1 Answers1

1

You should use a plain RollingFileAppender

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.MaxFileSize=10MB

etc

How do you get log4j to roll files based on date and size? points to an appender that uses both time and size

Community
  • 1
  • 1
Alftheo
  • 868
  • 7
  • 17
  • Thank you very much , but i want to use DailyRollingFileAppender because it comes nicely date wise and when i tried the above option with DailyRollingFileAppender it gave me no such attribute . – Pawan Dec 19 '11 at 17:50