2

Not sure if this should be on StackOverflow.. I followed this tutorial to install tomcat8 (with java8) on an ubuntu-12.04 instance. It uses the upstart script to install tomcat8 as as auto start service.

I'm using logback to do some logging in Tomcat. In the logback configuration I've configured a file appender like:

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
  <file>myApp.log</file>
    <encoder>
      <pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n  </pattern>
    </encoder>
</appender>

When I start tomcat I see some logging in var/log/upstart/tomcat.log that it doesn't have permissions (as tomcat-user)to create myApp.log, but I'm confused where myApp.log is being written to.

For now I indicated the hard url in my logback configuration, so my problem is solved. However I'm still curious.

4

I don't know your logger ch.qos.logback.core.FileAppender, but you could use some variables to log into a desired folder, E.G.:

To log into root of your tomcat base folder:

${catalina.base}/logs/myApp.log

or in your user folder /home/drjerry/:

${user.dir}/logs/myApp.log
1
  • If you have a logback.groovy, use: ${System.getProperty('catalina.base')} – RMorrisey Jun 19 '19 at 22:25

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.