Logging in GlassFish
When you deploy your application to GlassFish, your log statements are written to the server.log
file. You can view this file from the GlassFish admin web page (by default running on port 4848
) by navigating to Server | View Log Files, or you can just look at the file itself—it's found under your domain, for example, C:\adfessentials\glassfish3\glassfish\domains\domain1\logs\server.log
.
Tip
The log lines are rather long—if you want a different format, you can create your own formatter class as described by user Kawo on the site Stack Overflow:
http://stackoverflow.com/questions/9609380/glassfish-3-how-do-you-change-the-default-logging-format
You can also redirect your log output to a syslog
service as described by Markus Eisele on his blog:
http://blog.eisele.net/2012/07/glassfish-operations-log-notifications.html
GlassFish logging can be controlled by changing the logging.properties
file in the config
directory in your domain, for example, C:\adfessentials\glassfish3...