Issue Details (XML | Word | Printable)

Key: GLASSFISH-15777
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: sandeep.shrivastava
Reporter: stephanj
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

Introduce in the admin console a server.log syntax string

Created: 01/Feb/11 01:13 AM   Updated: 17/Oct/12 02:47 PM
Component/s: logging
Affects Version/s: 3.1_b40
Fix Version/s: 4.0.1

Time Tracking:
Not Specified

Tags:
Participants: naman_mehta, rajendra_inamdar, sandeep.shrivastava, stephanj and Tom Mueller


 Description  « Hide

It would be very convenient if the Glassfish admin could define the server.log output strings.
Today the strings are just too long to be practical and having the possibility to define the syntax could really make the server.log output more useful!



Tom Mueller added a comment - 01/Feb/11 06:21 AM

I'm not sure why this feature would be coupled to the admin console. There could be an interface to set a log format string in the console, but presumably there would also be an interface to set the format string via the asadmin command or by editing a config file.

Also, I'm assuming that the desire here is to be able to edit the format of all log messages, i.e., the timestamp, module, level, etc. parts rather than the actual messages themselves. Given this, I'm putting this in the logging category.


stephanj added a comment - 01/Feb/11 06:52 AM

As long as we can change the log messages syntax, that would be really helpful. Thx!


stephanj added a comment - 01/Feb/11 07:15 AM - edited

For example I'd like to change the following log output :

[#|2011-02-01T16:12:50.288+0100|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=311;_ThreadName=Thread-5;|[2011-02-01 16:12:50,288] INFO org.quartz.simpl.RAMJobStore RAMJobStore initialized.

#]

to

16:12:50 | INFO | org.quartz.simpl.RAMJobStore RAMJobStore initialized.

which when scanning the server.log would be a lot more user friendly!


naman_mehta added a comment - 02/Feb/11 12:40 AM

There is no provision right now to change the logging format as on today.

It used default format provided in 3.0: http://wikis.sun.com/display/glassfish/GlassFishV3LoggingMessageFormat

We can plan to consider the same in next release.


naman_mehta added a comment - 17/Apr/11 10:56 PM

If we provide this kind of provision then there are multiple issues.

Example:
1. User has used default setting and according to that data is logged under server.log file.
2. Now after sometime user has changed logging format setting to something else.

So if you open the server.log file there are set of the records with different format. Some records with default format and some with new format.

Now when user uses admin console to view log records using 'Log Viewer', it will fail there because of different log records format in the same server.log file. Parsing of the record is failing there. Back end code is not aware of the old format and tried to format old log records with new format setting and fails there.

Also in 'Log Viewer' screen there are advanced search options to filter log records. If user had changed the log record format completely then it might also fail there.

Need your opinion on the same.


rajendra_inamdar added a comment - 17/Oct/12 02:45 PM

The default log format will change to ODL format, which will support selecting certain fields to be included in the logged record. It will mitigate the need for this enhancement.


rajendra_inamdar added a comment - 17/Oct/12 02:47 PM

As noted by Naman above, allowing arbitrary change to the log format is risky since it will interfere with log parsing/viewing capabilities.