Tuesday, May 12, 2009

How to enable access logging in GlassFish

For debugging, monitoring and audit purposes it's sometimes useful to analyze access logs. 

By default Sun's GlassFish server has such logging disabled. It can be enabled by editing the domain.xml file (e.g. domains/domain1/config/domain.xml) and changing the accessLoggingEnabled attribute of the http-service element to true.

Following the restart of GlassFish the logs are available under the logs/access folder, (e.g. domains/domain1/logs/access/).

No comments: