Skip to main content

Tag: spring-boot

Unit testing a static custom logger in Spring Boot and log4j2

Last time I wrote a post about how to unit test a custom logger with log4j2. Today I migrated another custom logger from log4j 1.x to log4j 2.x, but this time it was encapsulated in a Spring Boot component as a static class attribute. Custom logger You have a simple custom logger public class SimpleCustomLogger { private final ExtendedLoggerWrapper log; private SimpleCustomLogger(final Logger log) { this.log = new ExtendedLoggerWrapper((AbstractLogger) log, log.