Don't count on being able to write to anywhere within your webapp. Tomcat, by default, expands your webapp to a directory and deploys your app from there. This gives you access to within your webapp via File IO. However, this is not guaranteed by the servlet spec. Your app can be run directly from the .war archive where you will have no File system access within the webapp structure. So, either provide some configuration for logging to a directory outside the webapp and allow the setting to be modifiable in the deployment configuration (such as a nested <Parameter> in a Tomcat <Context> entry) or do your logging to console or some other non-File appender.

If you do log to a directory inside your webapp structure, make sure you check that context.getRealPath("/") returns a non-null value first.

Jake

At 11:29 AM 2/19/2003 -0800, you wrote:
Any pointers/thoughts about web application logging practices? You generally
see almost each individual with different opinion about this (from logging
into the system temporary directory to inside WEB-INF).

Are there any best practices for this?

Thanks,
Manav.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to