André Warnier wrote:
> Mark H. Wood wrote:
> [...] good stuff
> 
>>
>> I think that's what is being asked: there should be *one page* that
>> begins with *everything you need to know* in order to say, "put the
>> log file there".  Just that.  After that, it's appropriate to point
>> out that much more subtle arrangements are available, and when you
>> want more, come back, here are pointers to all the hairy details.
>>
> 
> *YES*
> Thank you.
> 
> That's what I mean with a (revisited) <Logger> element :
> have some simple attributes in it, similar to the former Tomcat 4.1
> <Logger>, for a simple configuration.
> Then add a couple of attributes of the "delegate to" variety, for anyone
> who wants to make it more complicated, delicate, fine-tuned, whatever.

I don't think the logger element is going to make a return. However, the
current configuration system isn't that different in terms of what it lets
you do and allows the control you are looking for although it is more
verbose and the docs could do a lot more to make things clearer.

> Then give the possibility to copy and modify this <Logger>, and insert
> it into each webapp's web.xml or context.xml, to say "now this one logs
> some other way".  But if I remove this <Logger> from the webapp config,
> then it reverts to logging like its papa.

Replace <Logger .../> element with a logging.properties file and this
functionality exists now.

> I have no idea if this would be difficult, or if this is even possible
> or allowed with respect to Java or Servlet specs, but that's the idea,
> and it would be great for us Tomcat dummies if it was.

I think, and please tell me if I am wrong, that what is missing is a simple
guide to what goes in logging.properties. The current docs dive into the
deep end without covering the simple stuff first.

> Alternatively, maybe something can be done in the docs, but the problem
> would remain for guys like me who "get the Tomcat that's there", just
> want to add this one small webapp, and please-also-clean-up-the-logs,
> and have to figure out what the hell this is all about.

Improving / restructuring / re-ordering / adding to / deleting from the
content in http://tomcat.apache.org/tomcat-6.0-doc/logging.html is all
possible.

What would be useful is if you started a wiki page and set out the
structure you would like to see. Don't worry about the content. I or
someone else who knows the details can fill that in later. If you haven't
already found them the following might give you some ideas:
http://wiki.apache.org/tomcat/FAQ/Logging
http://wiki.apache.org/tomcat/Logging_Tutorial
in addition to the standard docs at
http://tomcat.apache.org/tomcat-6.0-doc/logging.html

> I have another point to add : maybe I understand this wrong, but it
> seems that with the current implementation, a webapp is able to decide
> where and how it logs, no matter what the overall server configuration
> says.  And that seems to me like the tail wagging the dog.
> But again, maybe I just don't understand how it works. I admit I don't.

I think this is the root of the issue. Each web application is free to use
any logging framework it likes. Tomcat has no control over the logging
framework - if any - that a web application may use. In the worst case,
each web application may use a different logging framework. Clearly this
creates a nightmare for a system admin trying to figure out how logging
works for each webapp. I think there are two ways to solve this problem,
neither of them technical. The first is set an organisation wide policy as
to which framework should be used. The alternative is require developers to
provide documentation with their web app that explains how logging is to be
configured for that application.

If you do help out and start a wiki page then maybe you could include a
section on web app logging and how to handle the common approaches:
- write everything to stdout
- log4j
- java.util.logging
- commons-logging

Mark



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

Reply via email to