Manu
Manu

Reputation: 1369

Logging using Log4j.xml in Glassfish

I was using WAS as my application server for deploying ear project.Presently changed to Glassfish. I am using log4j.xml file for logging. Logging is not working in Glassfish.

Is there any dependency in using log4j.xml with glassfish.

Any suggestions/pointers is appreciated

Upvotes: 1

Views: 6900

Answers (1)

armstrhb
armstrhb

Reputation: 4152

If your log4j library is included within your EAR file, then check your app server's JVM properties to ensure the log4j.configuration property is set:

  1. Login to the Glassfish Admin Console (http://[hostname]:4848/)
  2. For your server, navigate to Configuration > JVM Settings > JVM Options
  3. If an entry for -Dlog4j.configuration exists, verify that it contains the location of your log4j.xml file
  4. If an entry do not exist for -Dlog4j.configuration, create one. It must follow the following template: -Dlog4j.configuration=file:///path/to/your/log4j.xml

Upvotes: 4

Related Questions