The first time I heard about markers was while reading:
I checked available methods for the Logger object:
- http://www.slf4j.org/api/org/slf4j/Logger.html
- http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html
and found interfaces:
- http://www.slf4j.org/api/org/slf4j/Marker.html
- http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Marker.html
The more in-depth info I got from:
but I am still confused... Note that I asked why, not how to use them, so this is not a duplicate of:
UPDATE Seems that when you use markers you are also required to write custom Java code instead doing configuration in XML or .property files...
UPDATE 2 From http://logback.qos.ch/manual/appenders.html#OnMarkerEvaluator
Marker notifyAdmin = MarkerFactory.getMarker("NOTIFY_ADMIN");
logger.error(notifyAdmin,
"This is a serious an error requiring the admin's attention",
new Exception("Just testing"));
grep
over text logs. – gavenkoa