My JSP page has to log something in the file. For that purpose I have created a custom MyLogger class which has a static logging method. It receives a string, a name it should use for the file and it should create a file and put the string with logging info in it.
This MyLogger class, of course, resides in a WEB-INF/classes directory.
Upon testing it, however, I saw that the file gets created inside %TOMCAT_ROOT%/bin directory. Why? I thought that it would be created in an approppriate webapp directory, not there of all places...
How should I handle this?
Thanks in advance. Cheers!
Joined: Jun 05, 2004
the TOMCAT_HOME/bin is the current working directory. Take a look at ServletContext.getRealPath(java.lang.String)
Matthew Wilson<br />-http://valuelist.sourceforge.net