Boris Unckel wrote:
You want to have a _one_ central place for your log configuration _and_ the
correct logging just for that application - currently impossible.
I would not necessarely say that logging has to be configured in one
central place/file, but I think putting logging config _into_ the
applications is a bad idea.
Let me elaborate why:
The idea of a webapp is that you can deploy it on any spec-conforming
server without changes (to the webapp). Thus, good webapps need to stay
independant of specific implementations.
As "Juli" is very Tomcat-specific, placing logging.properties into the
webapp would create a dependancy to Tomcat 5.5 (for example ruling out
Tomcat 5.0 as a possible container for the same Servlet 2.4 app).
Furthermore, webapps should not (must not?) refer to files outside of
their webapp directory, so refering to ${catalina.base}/logs is really
bad practise (actually I'm surprised that it works). How can a webapp
know that their container has got that environment variable, and I can
it know that it points to a directory which contains a directory called
"logs"?
logging.properties also contains the log levels, something that is
usually container instance specific. For example, production
environments have different logging requirements than integration or
development environments, even if they use the same container
implementation. Would logging.properties be inside the application,
you'd have to customize log levels for each deployment. I don't know if
the widely used Eclipse/Web Tools Project combinations even allows for
automatic customizations during deployment. Surely you could write
complicated Ant scripts for deployment, but that's cumbersome and
old-school.
Thanks for your explanation about why real per-webapp logging is
currently not possible with Tomcat 5.5 and Juli/java.util.logging. Is it
the same with Log4J?
Personally I feel this is a big regression from Tomcat 5.0/4.1: With the
swallowOutput option, it was possible to do per-webapp logging _and_
"logging configuration outside of webapp" quite easily. I know
swallowOutput was just a hack for lazy System.out.println() coders, but
it had the nice side-effect of solving the problem very elegant and
efficiently. And there was nothing wrong with the option, just with the
habit of the lazy coders.
As far as I know, swallowOutput is not there any more. Could it be
re-activated? Is there anything else planned to support per-webapp logging?
Regards,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]