This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes using log4j in Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "using log4j in Servlets" Watch "using log4j in Servlets" New topic
Author

using log4j in Servlets

Raghavendra Rao
Greenhorn

Joined: Apr 13, 2004
Posts: 9
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...
eammon bannon
Ranch Hand

Joined: Mar 16, 2004
Posts: 140
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!
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Moving to Other Open Source Projects forum.
 
 
subject: using log4j in Servlets
 
Threads others viewed
Log4j output files
server could not started
Logging every 3Hrs using Log4j
Help required to log messages in tomcat :"Not able to log messages to separate files"
using log4j in Servlets
IntelliJ Java IDE