tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Tomcat producing (near) duplicate Catalina logs
Date Sat, 14 Jun 2008 00:31:12 GMT


Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> André,
[...]

By
> the same token, don't expect anyone in the Tomcat community to give you
> a primer on how to configure log4j when the documentation is just
> begging to be read over at logging.apache.org. :(
> 
I took you at your word, and just made another try at 
http://logging.apache.org.
I'm not saying it's your fault, but you've got to be kidding.
No wonder it's begging to be read.  I bet it isn't getting rich at it 
either.
Remember, I'm a Tomcat user, just looking for how to get a monthly 
logfile instead of daily ones.

One of the Tomcat gurus tells me that Tomcat gurus don't do logging, and 
that I should look at the commons-logging documentation at 
http://logging.apache.org., so I do.

There is no mention of anything else (juli ?) than log4j and derivatives 
on the Welcome page.
So I started with the log4j menu item, basically because it seems to be 
the only one mentioned there with relevance to Tomcat.
Logically (I thought), I started with the 2.0 version.  Wrong choice.
I downgraded my choice to 1.3.  Wrong choice also apparently.
1.2 is the thing, I guess.
Nice starting page.
Then I chose Documentation...Introduction in the menu at the left.
Nice general introduction.
Scrolling down and reading however, it gets into material that I believe 
might be appropriate to a Java programmer wanting to know how to insert 
logging statements in his code, but not exactly useful for someone 
looking for where log4j would hold the configuration smippets that tell 
one if it is going to create a monthly or daily logfile.
It continues with a couple of examples of logger hierarchies, and then 
it seems to stop rather abruptly.
Strange.  Usually, Introduction means introduction to something else. 
But there doesn't seem to be anything here after the Introduction.

The JavaDoc item does not seem particularly useful in my case either.

No problem, I switched to the FAQ.

I read all titles (1 to 31).  There does not seem to be anything there 
talking about where the configuration files are, or how this relates to 
Tomcat logging.
So I started reading sequentially.
Here is a snippet of about where I almost gave up :

The DOMConfigurator.configure(String filename) method and its variants 
require a JAXP compatible XML parser, for example Xerces or Sun's 
parser. Compiling the DOMConfigurator requires the presence of a JAXP 
parser in the classpath.
Uhu.

Scrolling down a bit more, I get a list of the following thrilling 
features :
- Logging behavior can be set at runtime using a configuration file. 
Configuration files can be property files or in XML format.
- log4j is designed to handle Java Exceptions from the start.
- log4j can direct its output to a file, the console, an 
java.io.OutputStream, java.io.Writer, a remote server using TCP, a 
remote Unix Syslog daemon, to a remote listener using JMS, to the NT 
EventLog or even send e-mail.
- log4j uses 5 levels, namely DEBUG, INFO, WARN, ERROR and FATAL.
- The format of the log output can be easily changed by extending the 
Layout class.
- The target of the log output as well as the writing strategy can be 
altered by implementations of the Appender interface.
- log4j supports multiple output appenders per logger.
- log4j supports internationalization.

Great stuff all of that probably, and it seems to say that you can do a 
lot of stuff in the configuration, but where /is/ the configuration file 
for Tomcat ?  That, it doesn't seem to say.

So after an hour, I'm pretty much back to square 1.

I am a Tomcat user, not a Tomcat developer.
I find Tomcat nice, I have a lot of respect for the people who develop 
it, and I am grateful to the people who answer rookie questions like 
mine on lists like this one.  I have no doubt that there are similar 
people in the log4j area.
But basically, I just want to install Tomcat, and run nice applications 
within it, with a minimum of trouble.
In this case, I would just like to know how to configure Tomcat or 
whatever, so that instead of having umpteen daily 
catalina.yyyy-mm-dd.log logfiles, I get only upmteen divided by 30 
monthly catalina.yyyy-mm.log logfiles.  Maybe even umpteen divided by 
365 yearly catalina.yyyy.log logfiles.
But for that, it seems that the first step is to find the Tomcat 
configuration file that would tell me if log4j is being used, or finding 
the log4j configuration file that shows something that looks like 
"catalina.xxxx.log".

I tried, but I'm not finding it.
Am I the only one in that situation ?


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message