0

I am charged with making migrating an app from centos 5.5 to centos 7.2. I can start my tomcat app using systemd but the app's log file is not being written to /home/tomcat where people expect it to be. (The app lives in /home/tomcat/uu/uusdc8.war.)

As far as I know, logging is 100% unconfigured for the app. If I run /opt/tomcat/apache-tomcat-7.0.27/bin/startup.sh, the app log is written to whatever dir I executed it from.

My question is, what is the simplest way to make tomcat/systemd write the app.log file to ~tomcat ? Here's an error I see in catalina.out.

log4j:ERROR Either File or DatePattern options are not set for appender [JSON]. log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: uusdc8.log (Permission denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:221) at java.io.FileOutputStream.(FileOutputStream.java:142) at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)

  • I exploded uusdc8.war and discovered there was a log4j jar inside. Question: Shouldn't log4j start when Tomcat starts instead of when the app's war is unpacked? – mr.zog Jul 16 '16 at 17:17
  • look for a log4j.xml or log4j.properties file in war – Federico Sierra Jul 16 '16 at 17:19
  • They don't exist. – mr.zog Jul 16 '16 at 23:53

Your Answer

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

Browse other questions tagged or ask your own question.