aspose file tools*
The moose likes Tomcat and the fly likes Tomcat log output - SOLVED Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat log output - SOLVED" Watch "Tomcat log output - SOLVED" New topic
Author

Tomcat log output - SOLVED

Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 153

Hello,

Our tomcat administrator has left us not too long ago, and now I'm tasked with maintaining the 5.5.17 tomcat server.

The output of the tomcat log, as specified in the log4j.properties file, is stopping at a certain point in the morning. The application runs continuously throughout the day and the output has always been steady. This started two weeks ago and I'm baffled.

It's not hurting the application as it runs fine. It's just that I rely on the log for debugging and testing.

Any advice you can give me is greatly appreciated.

Bill Clar
[ October 04, 2007: Message edited by: Bill Clar ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Are you using a rollingFileAppender?
If so, could it be that a new file is started at the same point the the first one stops receiving logging information?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 153

I believe so. I found this snippet in the log4j.properties file:

#
# Configuration for a rolling log file ("tomcat.log").
#
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'yyyy-MM-dd
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

By any chance, does it stop logging at midnight?
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 153

No, the server reboots at 4:00 am. We have logs from 4:00 am to 8:30 am, then nothing.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

With log4j, it's possible to change your logging levels at run time from within your program.

I'm wondering if someone wrote something that turns the logging levels up a 4:00 AM to debug some type of batch process and then, with the best of intentions, set it to turn the logging off when this process is done.

Do you know of any code in your application that does something automatically every morning?
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 153

I'm afraid that we don't utilize the log4j to our fullest advantage in that we don't utilize the debugging levels. All of our output comes from System.out.println(). It's not the best approach, but we have little time for refactoring at the moment.

All automated processes run at night, after hours. The output from those processes are piped to the default log of catalina.out without any problem.

I appreciate your help, Ben.

I'm going to consult with my system administrator and see if it could be a disk space or memory issue. Upgrading our version of Tomcat is another option.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you have access to source code, you might also want to grep for "setLevel".
You might find that something within your app is changing the levels without you knowing about it.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

I also agree with Ben. Perhaps, by looking into the code for the configuration changes would help a bit.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 153

I found the problem. The JReport log was interfering and piping the tomcat output into it.

Thanks for the help!

Bill Clar
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Bill, thank you for posting back with the solution.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

That's very true Ben. Thanks Bill for posting back the solution as it may help others with the relevant question.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat log output - SOLVED