0

Recently installed Tomcat 7 in windows machine and its running a web application. Under 'C:\Program Files\Apache Software Foundation\Tomcat 7.0\logs', I could find couple of different log files out of which I am interested in the log file 'tomcat7-stderr.2016-11-22.log'.

We have a linux machine which generates the log in location '/var/log/tomcat' but only generates the log 'localhost_access_log.2016-11-22.txt'. How can I enable tomcat to generate the 'tomcat7-stderr.2016-11-22.log' error log?

Thank You

0

From catalina.sh script comments:

#   CATALINA_OUT    (Optional) Full path to a file where stdout and stderr
#                   will be redirected.
#                   Default is $CATALINA_BASE/logs/catalina.out

$ export CATALINA_OUT=mylog.out

then run tomcat...

  • Thanks for the reply. Can this be added in catalina.properties file located in '\etc\tomcat'? – wenn32 Nov 24 '16 at 7:56
  • yes, if /etc/tomcat is read to build tomcat envirnonment. Else, this could be added in tomcat user's environment (e.g. .bashrc) or in startup script itself. – tonioc Nov 24 '16 at 11:41
  • "Default is $CATALINA_BASE/logs/catalina.out" So even if I don't add the "$ export CATALINA_OUT=mylog.out" it should still by default write to "$CATALINA_BASE/logs/catalina.out". Am I right? – wenn32 Nov 24 '16 at 12:07
  • Can you please explain this one in detail - "Else, this could be added in tomcat user's environment (e.g. .bashrc) or in startup script itself". – wenn32 Nov 24 '16 at 12:32
  • Yes the defaults should be to log to "$CATALINA_BASE/logs/catalina.out". Can you detail how exactly you start the tomcat server? – tonioc Nov 24 '16 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.