Saturday, September 11, 2010

Configuring Glassfish with log4j

Here's how you do it:

1. Place log4j.jar and log4j.properties file somewhere :
I put mine:
M:/Development/Java/glassfish/lib/log4j-1.2.15.jar
M:/Development/Java/glassfish/domains/domain1/lib/logging
2. Add the fully qualified path to the log4j.jar into the classpath of Glassfish together with the directory that contains the log4j.properties file. You can do that in the web UI: Application Server/JVM Settings/Paths/System Classpath and the entries are separated by a return.

3. Restart the server - if you are in asadmin, you need to exit and enter again.
Or else just do asadmin stop-domain and then asadmin start-domain

No comments:

Post a Comment