logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maple Wang <maple.feng.w...@hotmail.com>
Subject is there any way to add a marker to a logger rather than a log
Date Mon, 28 Mar 2016 08:35:42 GMT
Hi,

 

Marker is great feature for classifying and filtering log content, but I
have a question about how to use marker in logging API. In official guide
for log4j2.x, normally, we need to do as blow:

 

Marker myMarker =  MarkerManager.getMarker("myMarker");

LOGGER.info(myMarker,"some log message");

 

This is good, but in my situation, I want to add a marker directly to a
LOGGER, then, every time user use "LOGGER.info("some log message");", the
marker will be added automatically. Is there any way to help me to achieve
this?

 

Thanks in advance.

 

Best regards.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message