top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Tomcat 7.0 logging on different platforms

+1 vote
373 views

My development setup is Win7 while my production is RHEL6. Both of the environments have the same settings in conf/logging.properties but the files in logs/ are slightly different.

The access logs are named the same way. But on RHEL there's no tomcat7-stdout or tomcat7-stderr log files. Just 'catalina.out.YEAR.MO.DY' and the cumulative "catalina.out" with no date.

What accounts for the differences? Also, how would you stop logging to the 'catalina.out' file. It gets unusably gigantic within a few days.

posted Aug 22, 2013 by Amit Parthsarthi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

1) catalina.sh redirects stderr to stdout with 2>&1 and logs them to the same file, Windows service wrapper (Apache Commons Daemon procrun) logs them to separate files.

2) Just do not write to the console.
http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Considerations_for_productive_usage

answer Aug 22, 2013 by Kumar Mitrasen
0 votes

Remove the console logger from logging.properties

answer Aug 22, 2013 by Satish Mishra
Similar Questions
+2 votes

I'm receiving the following exception:

java.net.SocketException: "Permission denied": connect

when instantiating a Socket from a servlet:

final Socket smtpSocket = new Socket(mailTransportHost, mailTransportPort);

This application was running as a service under Windows Server 3003 R2 32-bits. After migrating it to Windows Server 2008 R2 64-bit, I cannot longer establish connection with the smtp server.

This only happen when running Tomcat as a service. Running as a standalone (starting it up using startup.bat) works fine. No exception instantiating Socket, emails are sent.

Environment:

 - Windows Server 2008 R2 64-bit
 - Tomcat 7.0.39
 - jdk1.6.0_33-x64
+1 vote

I am running Tomcat 7.0.41 on a Windows laptop (8.1 Pro). I recently reinstalled the Windows and since re-installing tomcat and my server application, it runs fine when I connect to it from a web browser.

However, when I tell my desktop client app to connect to the server, it fails on the initial connection with a 405status. I am running the server is debug, from Eclipse, and have put breakpoints in the doGet, doPost, and doPut methods of my ControllerServlet class that extends the java.servlet.http.HttpServlet. None of these breakpoints fire before the client gets back the 405 status. (the client works fine if connecting to the real server running tomcat 6 on an Ubuntu server.)

I can find no place locally where verb filtering is being configured.

Any suggestions?

0 votes

We currently are setting a site that receives fairly heavy traffic (5000 simultaneous users). We have two physical servers.

As a general idea, is there performance to be gained by running multiple instances of Tomcat 7.0? For example, two instances on one physical server and two instances on the other physical server? Assume all are running the same webapp.

+2 votes

I am using the below appenders in my domain.xml file to point all the logs from my application to app.log. I see the file is getting created but there are no logging happening.

 <periodic-rotating-file-handler name="CACHE-FILE" autoflush="true">
            <level name="DEBUG"/>
            <formatter>
               <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
            </formatter>
            <file relative-to="jboss.server.log.dir" path="app.log"/>
            <suffix value=".yyyy-MM-dd"/>
            <append value="true"/>
         </periodic-rotating-file-handler>

           <logger category="com.abc.cache" use-parent-handlers="false">
               <level name="DEBUG"/>
               <handlers>
                  <handler name="CACHE-FILE"/>
               </handlers>
           </logger>
...