• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Rolling Using log4J

 
Sivakumar Nachimuthu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing large volume of data in a text file.So i want to roll the file based on size .How it is possible with log4j API?

Plz help me .
 
Amar Prasad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is file called log4j.properties.

You can specify the size of the file and max no. of backup copies here.

log4j.appender.inboundFileDest=org.apache.log4j.RollingFileAppender
log4j.appender.inboundFileDest.File=log/XXX.log
log4j.appender.inboundFileDest.MaxFileSize=5000KB
log4j.appender.inboundFileDest.MaxBackupIndex=5

Thanks & Regards
Amar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!