[ 
https://issues.apache.org/jira/browse/LOGCXX-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17642706#comment-17642706
 ] 

Robert Middleton commented on LOGCXX-555:
-----------------------------------------

Upon further investigation, it doesn't seem like this is easily possible.  The 
original intention was to let you define a custom pattern converter(let's say 
%A) and have that print out something new that you have put in the log message. 
 However, due to how log4cxx is implemented(with LoggingEvents that hold 
strings and are constructed once) this is really not possible to do.

We could theoretically add a map to the LoggingEvent that holds some kind of 
arbitrary map of objects, but that sounds like it is just re-implementing the 
MDC at that point.  So really if you want this then you should just put 
something in the MDC and use that to store more information with your log event.

> Allow for custom pattern converters
> -----------------------------------
>
>                 Key: LOGCXX-555
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-555
>             Project: Log4cxx
>          Issue Type: Improvement
>            Reporter: Robert Middleton
>            Priority: Minor
>
> With the PatternLayout, there are only a relatively small number of pattern 
> converters that exist.  e.g. %m for message, %L for location, etc.  Allowing 
> users to define custom replacement patters could make this expandable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to