Can you make the Tomcat 6 stdout.log file as log4j DailyRollingFileAppender?

We use the installation of Windows Tomcat 6. By default, the output of log4j for our application goes to the file $ {catalina.base} /logs/stdout_.log. This log file overflows only when Tomcat restarts, and the file name always includes the date.

I would prefer it to behave like a DailyRollingFileAppender, where it renames the file when it rolls ... so I can just open Notepad ++ and see today's logs, since Notepad ++ will remember that I opened the same file yesterday.:)

I know that I can just create another appender in log4j, but in the end we get the stdout.log file and another log file, and I am afraid that when registering in both files there will be a slight performance hit. I tried adding swallowOutput = true to my context.xml, but I still get all the entries in stdout.log. Any ideas?

+3
source share
2 answers

Have you tried the steps described in Logging in to Tomcat ? If you follow the steps, you will end up with log4j.properties in the lib directory, which you can configure for your hearty content.

0
source

- , ( , logger.info(" operating on " + myObject.toString + " bla bla bla" ), myObject.toString() ). , loggin , . log4j , , .

, tomcat appilcation. ? 1 , ? . - .

0

Source: https://habr.com/ru/post/1727521/


All Articles