Where to store WAR application log files?

I am trying to configure logging for my web application (WAR) in log4j.properties:

log4j.rootCategory=WARN, RF
log4j.appender.RF=org.apache.log4j.RollingFileAppender
log4j.appender.RF.File=???/my-app.log

Which file path should I specify for my-app.log? Where to save this file? I am currently deploying my application in Tomcat6, but who knows what will happen in the future. And who knows how exactly Tomcat will be configured / installed on another machine in the future.

+3
source share
4 answers

What I finally did was:

  • In continuous integration, settings.xmlI define a propertylog.dir
  • In log4j.propertiesI define:log4j.appender.RF.File=${log.dir}/my-app.log
  • Q pom.xmlI instruct Maven to filter .properties files

. - .

+2

- , . - , .

, tomcat ${catalina.home}/logs/myapp.log, , , weblogic, catalina.home, c:\logs\myapp.log.

+2

@cherouvim. webapp , .

webapp, , webapp .

+1

my-app.log? ?

, . , (, ).

, IST, UAT .., . , , .

Tomcat6, , .

, , : /var/log/tomcat/<PROJECTNAME>/myApp-<instance-#>.log.

, , , , :)

, Tomcat / , .

To save the configuration file, you can configure it as needed ... and even change it :)

+1
source

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


All Articles