Where do my log files for my webapp on a Linux installation of Tomcat 7 go?

I am currently developing a simple web application using Eclipse and the local Tomcat 7 server. I configured Eclipse to run Tomcat 7 directly from my IDE - there is not much magic here.

In my web application, I use SLF4J with Logback, which looks in this class:

public class MyServiceImpl implements MyService
{
  private static Logger logger = LoggerFactory.getLogger( MyServiceImpl.class );

  public void doSomeStuff()
  {
      logger.info( "Doing some stuff" );
  }
}

My log is configured this way:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <appender name="fileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>log/MyTestWebApp.%d.log.zip</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="com.test" level="WARN" />

    <root level="WARN">
        <appender-ref ref="fileAppender" />
    </root>

</configuration>

When I run my web application and thus the local Tomcat 7 server, the log output will be

./log/MyTestWebApp.log

as expected, where the current directory is where my web application is (for example, where my Maven pom.xml is).

When I run my web application on a remote Linux machine, I cannot find the file "MyTestWebApp.log", not in my application, nor in the root directory of Tomcat7.

, : MyTestWebApp.log ?

!

+5
2

Tomcat. :

grep -az "\bPWD" /proc/TOMCAT_PID/environ
+4

tomcat7? /var/lib/tomcat 7? root, Tomcat7 "log".

,

sudo chown tomcat7:tomcat7 /var/lib/tomcat7

, , Sekm

+3

All Articles