Set up intentional logging
Creating an instance of intentional logging is a multi-step process.
Procedure
-
Create an instance of
IntentionalLoggerin the class in which the logging is to take place using the following static factory method:- IntentionalLogger.from(logger)
The following code snippet illustrates how to create a new IntentionalLogger instance with a specific associated with a specific PLoggerCategory marker.var IL = IntentionalLogger.from(PLLoggerCategory.MARKER_TYPE)
-
Use one of the available methods available on the IntentionalLogger
interface to log the event of interest.
The following code snippet illustrates how to call the
IntentionalLoggerentity (IL) created in the previous step.IL.logStart(MY_SLF4J_MARKER)
What to do next
log4j2.xml and add a JSONDailyFile logger that supports
JSON logging.