Event Logger
EventLogger
is a convenience to log StructuredDataMessage
s, which format their content in a way compliant with the Syslog message format described in RFC 5424.
Historically, EventLogger
was added to help users migrate from SLF4J EventLogger
, which was removed in SLF4J version 1.7.26
.
Event Logger is deprecated for removal!
We advise users to switch to plain |
Compared to using a plain Logger
, EventLogger
That is, following EventLogger
usages:
EventLogger.logEvent(new StructuredDataMessage(...));
EventLogger.logEvent(new StructuredDataMessage(...), Level.INFO);
are equivalent to the following plain Logger
usages:
private static final Marker EVENT_MARKER = MarkerManager.getMarker("EVENT");
private static final Logger LOGGER = LogManager.getLogger();
LOGGER.log(Level.OFF, EVENT_MARKER, new StructuredDataMessage(...));
LOGGER.info(EVENT_MARKER, new StructuredDataMessage(...));