XML message logging

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

XML message logging

Prashant Reddy
Hi all,

Should we have an option in the server configuration that controls whether (i) XML messages are logged inline with the log message (i.e., single line, no formatting), or (ii) as they are now (on a new line after the log message, with formatting).  

Option 1 makes it much easier to pull out the XML from the log files using grep for post-game analysis, whereas option 2 is better for readability when visually inspecting the logs.  Ideally we'd have two log files, one with each option but that seems wasteful.

Any component that logs XML would then need to inherit this configuration option throughout the server.  Or we could provide a utility function in common that formats the log message based on the config... something like:
----
logWithXml.info("some text", someXml);
----
or
----
log.xmlInfo("some text", someXml);
----

Thoughts?  Do others see this is a key issue for log analysis?  Are there other easy ways to pull out whole XML messages from logs that I'm not thinking of?

Thanks,
Prashant