On Jun 10, 2007, at 2:57 AM, Scott Deboy wrote:
log4j 1.3 included the ability to set properties at the logger
repository level (if it was a loggerrepositoryex) - logger
repository properties would be added to all events associated with
the repository.
That feature isn't currently available in the 1.2.15 codebase, and
I was curious if it's something that we want to avoid because of
backward compatibility issues, or if it's ok to add the feature
back in.
In Chainsaw, we use this feature to get all chainsaw-specific
logging events to route by default to a chainsaw-log tab.
log4j 1.3 reworked LoggingEvent significantly and introduced the
serialization incompatibilities. I'm not sure how many of those
changes were related to repository properties. I looked at the
log4j 1.2 code and it looked like the easiest way would be to modify
LoggingEvent.getMDC() and LoggingEvent.getMDCCopy() to get the
logger's repo and then check for LoggerRepositoryEx. However, before
risking introducing an unintended side-effect on a significant code
path, I'd really like to understand the immediate need of Chainsaw
and try to find another approach would not have the same potential
for calamity.
The only place LoggerRepositoryEx.setProperty() was used seemed to be
around line 338 in o.a.l.chainsaw.LogUI. Is there a specific reason
why calling MDC.set() would not work?