aspose file tools*
The moose likes Tomcat and the fly likes The messages I send to catalina.out are not being written Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "The messages I send to catalina.out are not being written" Watch "The messages I send to catalina.out are not being written" New topic
Author

The messages I send to catalina.out are not being written

Brad Moss
Greenhorn

Joined: Oct 06, 2011
Posts: 2
Hi,

I develop apps with an app generator, so I actually don't know too much Java nor Tomcat
But as a developer I write messages for the purposes of debugging my app to the Catalina.out file.


It works ok in my testing environment and it worked ok in production environment, but yesterday I needed to look for an xml I was sending to invoke a web service and noticed the logs stopped work since February.

Now is not that the Catalina is not logging, it logs other apps running on the server, but is just nor logging my application.

I asked the server administrator and he just cant solve the problem.

I am sure there must be some kind of configuration maybe in the web.xml file??

Can somebody give me a tip on where to look for the problem?

We are using Tomcat 5.5.25 just in case it matters.

TIA,
Brad.-

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Welcome to the JavaRanch, Brad!

It is not a good idea for webapps to write to System.out or System.err. Catalina.out is the common capture location for the Tomcat JVM's System output streams, but there is nothing in either the J2EE or Tomcat specs that say that a given instance of Tomcat is obliged to either write a catalina.out file or to preserve system output streams at all. If Tomcat doesn't want to write these streams, it has every right to simply dump the output down a well.

And in one or 2 Tomcat distributions, that's exactly what it does. It sounds like you're one of those fortunate enough to have encountered one.

For general quick hacking while developing, a write to System.out isn't going to cause you much grief (assuming you're not working in a shop where there's a Dilbert rule about everything). However, once you move to production, you should be using a more appropriate logging mechanism.

Java has a number of choices for loggers, including some interfaces specifically designed to reconcile the cases where large webapps are made up of library components which each have made their own separate decision of which logger to use.

The simplest logger to use is the "juli" logger, which is part of the standard JRE since Java 1.4. "juli" gets its acronym from the package name (java.util.logging interface, if my memory is correct). Log4j is also very popular and you can control where the log output goes from a log4j config file in your WAR's classpath.


Customer surveys are for companies who didn't pay proper attention to begin with.
Brad Moss
Greenhorn

Joined: Oct 06, 2011
Posts: 2
The Java Code generated is:

System.out.println( "String" );


Just looked for it in the .java generated.

Thank you,
I don't understand much of what you are saying
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The messages I send to catalina.out are not being written