close

Filter

loading table of contents...

CoreMedia Content Cloud v11 Upgrade Guide / Version 2110

Table Of Contents

6.12.8 Using Standard Spring Boot Logging Configuration

The logging setup has changed to implement a more standardized setup. This includes:

  • Disabling the file appender by default.

  • Removed any third-party logback appenders to push logs events directly to a log aggregation like elasticsearch.

  • Removed the Spring-Boot elk profile to activate elastic log aggregation.

  • Removed the com.coremedia.blueprint:logging-config Maven module.

  • Removed any logback-spring.xml file in favor of Spring Boot standard setup.

  • Removed the Studio Console logfile endpoint.

  • The logging pattern has been changed to integrate better with container based deployments and cloud native logging solutions like the Elastic stack and the Grafana Loki Stack.

    The new logging pattern for the console appender no longer contains a timestamp. In the recommended setup, the log events are digested from the container runtime and then shipped to the log aggregation service. Since all container runtimes add a timestamp by default, adding a timestamp with logback is redundant. The logging pattern also does no longer contain coloring, since that unnecessarily complicates the processing of the log events.

Removal of Logback appenders

Instead of using this approach please use one of the many log shippers available to send logfiles to an elastic stack.

Removal of logback-spring.xml files

If you need to customize your logging you can add logback-spring.xml files again to the *-app/src/main/resources folder and follow the standard customization steps described in the Spring Boot documentation.

Removal of the Studio console endpoint

The endpoint was intended to be used similar to the logfile endpoint of the standard Spring Boot actuators. To view the studio-console logger, please use standard log queries in your log aggregation stack of your choice to separate the studio-console logger from the studio-server logs.

Standard console logging pattern

For an easier integration with log shippers, the logging pattern has been changed:

  • Any coloring has been removed for console and file logging except for local profiles, when the application is started using the IDE or the spring-boot-maven-plugin plugin.

  • The timestamp has been removed for standard console logging. The container logging always contains the timestamp and the shippers parse this timestamp anyway.

  • The pattern has been reordered so that the message is the last entry. This simplifies the handling of multiline strings.

The new logging pattern for the file logger will be:

 %d{yyyy-MM-dd HH:mm:ss} %-7([%level]) \\(%thread\\) %logger [%X{tenant}] - %message%n 

The new logging pattern for the console logger will be:

 %-7([%level]) \\(%thread\\) %logger [%X{tenant}] - %message%n 

If you want to keep the old pattern, set the following property respectively environment variable logging.pattern.file, LOGGING_PATTERN_FILE to the following:

 %d{yyyy-MM-dd HH:mm:ss} %-7([%level]) %logger [%X{tenant}] - %message \\(%thread\\)%n 

For the console logger set logging.pattern.console or LOGGING_PATTERN_CONSOLE to the following:

 %clr(%d{yyyy-MM-dd HH:mm:ss} -){faint} %clr(%7([%level])) %clr(%logger){cyan} [%X{tenant}] %clr(-){faint} %message
 \\(%thread\\)%n 

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.