Hello Ceki, What is the status of the bug (32752) related to this (I see no additional comment or change to the bug report)?
I hope that the signature will be reverted to that of log4j 1.2, so that usability can be preserved. Hein fre, 25,.02.2005 kl. 10.23 +0000, skrev Vinay Sajip: > Hello Ceki, > > > First, in log4j 1.3 you can attach properties to a logger repository > > so that all components attached to that repository, such as loggers, > > appenders, layouts, inherit those properties. However, the values of > > these properties are of type String. When log4j 1.3 internally > > processes logging events, the MDC properties and loggerRepository > > properties are viewed as properties of the logging event being > > processed. There is no distinction between properties originating in > > the MDC and those properties originating in the containing > > LoggerRepository. In short, the MDC properties and LoggerRepository > > properties are merged inside the logging event. This merging > > operation is easier to do if the values are all of the same type, > > namely String. > > OK, but you can document that all objects in the MDC will have toString() > called > at the appropriate point. Then the developer can provide a suitable > toString() > for their needs. > > > The second reason has to do with the way LoggingEvents are > > serialized. Data supplied by the user such as MDC properties or the > > event's message are transformed into type String before transmission > > over the wire. > > This could be done via toString(), as above. > > > So it seemed reasonable to impose that the MDC data be of type String > > right from the start. However, your remarks show that this premise has > > important drawbacks from the user's perspective, which I have to > > admit, I was not aware of. > > > > If the overhead incurred while merging the MDC properties and > > LoggerRepository properties increases significantly when the type of > > MDC properties is Object instead of String, then the current > > signatures are preferable. However, if the additional overhead is > > small, then obviously we will revert to the old signature. > > The additional overhead involved is effectively calling toString() on all > entries in the MDC, which is minimal if users add Strings to the MDC; in the > case of other objects, the price they pay is that of their toString() > implementation. > > Best regards, > > > Vinay Sajip > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]