I tried to redirect Tomcat console output to a text file and it works fine for my web application, but the problem is, it overwrites everytime when Tomcat started. I need to create a log file (file name along with date and time) and should create new file everytime when Tomcat, ie starts should not overwrite. and the file name should also include date and time
please, help me how can i do this?
tomcat 6.0,
windows environment
catalina.bat run > log.txt 2>&1
i put this inside start.bat (start.bat: sets catalina_home and java_home and starts startup.bat which starts the server and redirects the console output by catalina.bat run > log.txt 2>&1 )
I also tried log4j
`log4j.rootLogger = INFO, FILE
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=C:\path\logs\log4j.txt
log4j.appender.FILE.ImmediateFlush=true
log4j.appender.FILE.Threshold=debug
log4j.appender.FILE.Append=true
log4j.appender.FILE.DatePattern='.' yyyy-MM-dd-a
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n `
but this writes the info only from Docx4j Api that i use for creating word doc. not writing sys out and sys err values ie system.out.println() values. I also tried like this but didnt work