Chaz Cowan

Greenhorn
+ Follow
since Jun 04, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chaz Cowan

Tim Holloway wrote:No, you don't need to muck around with your Tomcat or JVM settings - and especially not the security settings.

It is better, however, if you give an absolute pathname and not a relative name for your logfile, and yes, the log4j.properties file must be located in the WEB-INF/classes directory of your WAR. Whether Tomcat exploded it out or not, it does have to be in the orignal WAR that you deploy.

Incidentally, just in case you didn't know - and it's not well documented - when an exploded WAR is detected in the Tomcat webapps directory and an unexploded WAR is present in the same directory, the exploded WAR is the one that gets used. Even if the unexploded WAR is newer than the exploded WAR! The safest way to deploy is either to delete both exploded and unexploded copies before updating or to turn off the option to explode.



Ok I removed the entry I tried to make in the catalina.policy file just in case that would mess stuff up.

I also altered my ANT build file so that it includes the log4j.properties, and the file now ends up in the WEB-INF/classes directory when Tomcat unpacks the WAR file.

I altered my log4j.properties file to use absolute paths for the log files to see if that would help(I tried it with "\\" and "/" and "\" delimeters):


It still doesn't seem to want to log anything, or even create the log files themselves. I even stopped the server, deleted everything, then copied my WAR file into webapps, then restarted it each time I changed anything. Any other ideas?
13 years ago
I found a few resources detailing how the Catalina.policy file by default only allows web applications "read" access to files. Is this true?

I've been trying to alter the policy file to allow my application read/write/execute, but am so far unable to do so.

13 years ago
I have been trying to get my (smartgwt)application to log using the log4j jar. It works fine in Dev Mode, but when I deploy it to tomcat the log files denoted by the configuration don't even seem to appear.

The following log4j.properties file is in my war directory for my app:


Just to get it working I have a simple class with static log methods only accessing the rootLogger:


On server side calls I simply have statements such as:


Are there settings within the Tomcat environment to allow application specific use of log4j, or am I simply going about this wrong? I have read in a few places about people saying to put my .properties file into WEB-INF/classes directory, but when my war file is unpacked by Tomcat I don't see that directory.
I have been trying to get my application to log using the log4j jar. It works fine in Dev Mode, but when I deploy it to tomcat the log files denoted by the configuration don't even seem to appear.

The following log4j.properties file is in my war directory for my app:


Just to get it working I have a simple class with static log methods only accessing the rootLogger:


On server side calls I simply have statements such as:


Are there settings within the Tomcat environment to allow application specific use of log4j, or am I simply going about this wrong? I have read in a few places about people saying to put my .properties file into WEB-INF/classes directory, but when my war file is unpacked by Tomcat I don't see that directory.
13 years ago