[
https://issues.apache.org/jira/browse/LOG4J2-1015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14549866#comment-14549866
]
Ralph Goers edited comment on LOG4J2-1015 at 5/19/15 6:20 AM:
--------------------------------------------------------------
Actually, that is not true. If you use the MarkerLookup outside of processing
log records (such as in the configuration file) I believe it will return the
key value if the marker exists and and null otherwise. It would be trivial to
do something like "return the name of the marker if the key is "*", otherwise
return "true" if the event matches the marker key name and false otherwise (or
return the key name if they match).
I am not saying we should change the implementation, but if you think it would
be less confusing to require a key this is how it could work.
was (Author: [email protected]):
Actually, that is not true. If you use the MarkerLookup outside of processing
log records (such as in the configuration file) I believe it will return the
key value if the marker exists and and null otherwise. It would be trivial to
do something like "return the name of the marker if the key is "*", otherwise
return "true" if the event matches the marker key name and false otherwise (or
return the key name if they match).
> Add a way to route messages based on the %marker in Layout for RoutingAppender
> ------------------------------------------------------------------------------
>
> Key: LOG4J2-1015
> URL: https://issues.apache.org/jira/browse/LOG4J2-1015
> Project: Log4j 2
> Issue Type: New Feature
> Components: Appenders
> Affects Versions: 2.2
> Reporter: Daniel Marcotte
>
> Hi,
> It seems there's no way to route messages based on the Marker in the
> RoutingAppender. The "%marker" is not part of the Layout. When using SLF4J,
> since it's a core feature of the facade, this would help greatly if it was
> possible to route messages based on the Marker.
> Main StackOverFlow question (answered) :
> http://stackoverflow.com/questions/30111754/log4j2-is-there-a-way-to-route-logs-based-on-marker-with-the-routingappender
> Workaround StackOverFlow question (answered) :
> http://stackoverflow.com/questions/30247323/how-to-create-custom-rewritepolicy-in-log4j2
> Thank you
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]