In this example we define a simple Logging Utility (Logging.java) that initializes
structured logging with some good defaults (including the ModelFormatter
) and provides a factory method to return a structured logger instance with
the defined logging schema.
See:
- Logging.java - project-specific factory for structured logging
- LoggingSchema.java - a single logging schema for the project
- RequestHandler.java - structured logging example
- UpdateService.java - structured logging example with composed logging. Also has an example of using @DoNotLog to prevent sensitive data from being logged.
- RestEndpoint.java - example of using structured MDC