On 20.06.2012 23:35, Lahiru Gunathilake wrote:
Hi Jeff,

Thanks for the response, actually my requirement is to make the life easier
for the admin, and if something goes wrong he has an ID of the request
which failed (This is not a system which is getting millions of http
requests) and then he should be able to figure out the logs for that
request based on the ID he has.

If you have a solution for that, kindly let me know, I am happy to use it..

Many log frameworks support setting a thread local and adding it to every log message as part of the log format configuration. For SLF4J look for "Mapped Diagnostic Context" in

http://www.slf4j.org/manual.html

Assuming your batch type request handling is using only a single thread for each request, you can put the request ID into the MDC and add the MDC automatically to every log message you produce during the run of this request (by simply adding it to the log format configuration instead of adding it to each log statement).

Then your admins can simply grep/search for the request ID in the log file.

Regards,

Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to