Logging in GlassFish

One feature that I like very much from GlassFish is we can view server log files
through web interface. However I must do something in my application to enable GlassFish display my application log statement properly. GlassFish log viewer expect a message id to prefix the log information. If you do not give any message id
GlassFish will sometimes misinterpret your log info and not display it in proper format.

After a little bit research I found out that GlassFish expecting 3 upper case alphabetic character as prefix and 4 numeric follow after the prefix and a colon as
message id format. So after formmating all my logging information as “XXX0001: log message” GlassFish display all my logging statement properly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s