• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.


Posts: 20836
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Brad Moss
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!