Blog Archives

Spring 4.3: Using a TaskDecorator to copy MDC data to @Async threads

In this post I am going to show how to copy MDC data from Web threads to @Async threads using a brand new Spring Framework 4.3 feature: ThreadPoolTaskExecutor#setTaskDecorator() [set-task-decorator]. This is the end result: Notice the third and second last

Tagged with: ,
Posted in Spring

Java: Custom logger factory that automatically infers the class name

In this post I show how you can declare loggers like this: There is no argument to the MyLoggerFactory::getLogger method. Contrast that to the normal way to declare a logger: This is business as usual. But have you ever made

Tagged with: ,
Posted in Java SE

Spring Boot: Show all logging events for one Web request only

In this post I show how you for a single Web request can make your Spring Boot application dump all log statements on all categories (TRACE, DEBUG, INFO, WARN, ERROR). Everything – but only for the specific Web request that you care

Tagged with: ,
Posted in Spring
Archives
Subscribe

Get notified per email when new posts are published