Set up intentional logging

Creating an instance of intentional logging is a multi-step process.

Procedure

  1. Create an instance of IntentionalLogger in 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)
  2. 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 IntentionalLogger entity (IL) created in the previous step.
    • IL.logStart(MY_SLF4J_MARKER)

What to do next

If you intend to log JSON data, you also need to modify file log4j2.xml and add a JSONDailyFile logger that supports JSON logging.