• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem log tomcat6

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
after a day of searching I cannot solve my problem!
In fact on my server.xml I have two web app as following:



I would like a log file (logs System.out and / or System.err.) For each application (instead of having them all in catalina.out).
with Access log it works perfect, but it does not work with logFile
I tried the following configuration, but the files have not been created

<

Have an idea?
Thank you in advance.
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Illyass, and welcome to JavaRanch!

We see this question from time to time and the answer really is: don't write to standard out (stdout) or standard err (stderr) from a web app. Actually, writing to stdout and stderr is almost always a bad idea. You should be using a logging framework instead. The one recommended by Apache is, not surprisingly, Apache Commons Logging. See the Tomcat Logging FAQ here: http://wiki.apache.org/tomcat/FAQ/Logging

Logging isn't really that hard to configure, and it's a long-established best practice. Retrofitting all your System.print statements to log statements may be the hardest part, depending how many there are, but it'll be worth it. I promise!
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the best arguments for using a real logger instead of the System output/error streams is that there's no guarantee in J2EE where System.out and System.err output will go. In a few cases, it even gets totally discarded. J2EE is not required to support the stdio data streams and it doesn't. Cases where it pretends to are extremely implementation-dependent.

In contrast, if you set up a logger for a webapp, you know exactly where the output will go.
 
reply
    Bookmark Topic Watch Topic
  • New Topic