• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

using log4j in Servlets

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All!!
i have used DailyRollingFileAppender in properties file and used DatePattern. This properties file is being used by a servelt and i want to create a new file for every minute but i am not able to do this . The log statements are overwritten and i am able to log only the latest minute log statements in the file log/log4joutput3.txt. (i am able to get in a standalone program but not able to get the same through servlets)
the properties file i have used is given below :
log4j.logger.demo.log4j.servlet.LogonServlet=debug, R1
log4j.additivity.demo.log4j.servlet.LogonServlet=false
log4j.appender.R1=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.R1.Append=false
log4j.appender.R1.File=log/log4joutput3.txt
#log4j.appender.R1.DatePattern='.'yyyy-MM-dd-HH-mm
log4j.appender.R1.layout=org.apache.log4j.PatternLayout
log4j.appender.R1.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n
Please help me....
thanks in advance...
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I ask why you would want to create a new log file every minute? It sounds like a good way to crash the server - if its running for only a week you'll have more than 10000 log files!
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Other Open Source Projects forum.
 
Raghavendra Rao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Raghavendra Rao:
Hi All!!
i have used DailyRollingFileAppender in properties file and used DatePattern. This properties file is being used by a servelt and i want to create a new file for every minute but i am not able to do this . The log statements are overwritten and i am able to log only the latest minute log statements in the file log/log4joutput3.txt. (i am able to get in a standalone program but not able to get the same through servlets)
the properties file i have used is given below :
log4j.logger.demo.log4j.servlet.LogonServlet=debug, R1
log4j.additivity.demo.log4j.servlet.LogonServlet=false
log4j.appender.R1=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.R1.Append=false
log4j.appender.R1.File=log/log4joutput3.txt
#log4j.appender.R1.DatePattern='.'yyyy-MM-dd-HH-mm
log4j.appender.R1.layout=org.apache.log4j.PatternLayout
log4j.appender.R1.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n
Please help me....
thanks in advance...

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic