log4r - context (NDC)

L

listrecv

Is there anyway to set a context for log4r?

log4j has somethign like NDC

Basically, in a web app, I'd like to correlate messages for the same
client. I'd like to do something like

context = "#{user.ip} #{user.name}"

and have it automatically appended to each logging message, or, even
better, appended whenever the context changes (that is, if there are 5
messages in a row from the same user, no need to keep repeating the
context)

is this available?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,666
Latest member
selsetu

Latest Threads

Top