users@glassfish.java.net

changing the log format

From: Dies Koper <dies_at_jp.fujitsu.com>
Date: Fri, 03 Aug 2007 16:14:05 +0900

Hello,

Is there a simple way to change the log format of the lines written to
server.log?
#I checked the GUI
By default the lines are quite long, with the most important information
(the message itself) last.

For example:
[#|2007-07-30T14:15:12.515+0900|WARNING|sun-appserver9.1|javax.management.remote.misc|_ThreadID=23;_ThreadName=Thread-41;_RequestID=b6341cc8-508c-482f-8756-025e4de94b6a;|Failed
to check connection: java.net.ConnectException: Connection refused:
connect|#]

I suppose my mail program will wrap this message, but my text editor
does not, so I can't see the actual message unless I scroll to right.

I'd like to see the most important fields first:
1. timestamp (to prevent me from looking at old messages)
2. level (many INFO messages are written and I only want to check if
there were no big problems)
3. the message itself

Depending on the message I might be interested in the thread info (only
with threading issues I suppose, or to compare the RequestID with
entries in other logs?), or the component (for debugging GF?), but only
AFTER I checked the message.
I am not sure why the product version is output for each message.
Because Sun changes its product name by the second? ;)

So I'd like to swap the order of the fields.

Also, most fields only note their value, but the thread field also seems
to include labels (_ThreadID, _ThreadName and _RequestID) cluttering up
the line even more. Why?
If they are always written in the same order, why not drop the labels?
We can figure out which value starts and ends where from the separators
(';') between them...

Thanks,
Dies