[GLASSFISH-15777] Introduce in the admin console a server.log syntax string Created: 01/Feb/11  Updated: 21/Sep/15

Status: Open
Project: glassfish
Component/s: logging
Affects Version/s: 3.1_b40
Fix Version/s: 4.1.1

Type: Improvement Priority: Major
Reporter: stephanj Assignee: sandeep.shrivastava
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


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!

Comment by Tom Mueller [ 01/Feb/11 ]

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.

Comment by stephanj [ 01/Feb/11 ]

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

Comment by stephanj [ 01/Feb/11 ]

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.



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

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

Comment by naman_mehta [ 02/Feb/11 ]

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.

Comment by naman_mehta [ 17/Apr/11 ]

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

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.

Comment by rajendra_inamdar [ 17/Oct/12 ]

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.

Comment by rajendra_inamdar [ 17/Oct/12 ]

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

Generated at Wed Dec 07 08:57:21 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.