Customize SLF4J Logger
问题 I'm trying to find a nice way to add a prefix to my logs without passing it on every calls, without instanciate Logger again. The purpose is to trace Rest calls individually. (The prefix would be re-generated on each call using UUID) This would be like @RestController class MyClass { //Here the prefix is initialise once //default value is X Logger LOG = LoggerFactory.getLogger(MyClass.class); @RequestMapping("/a") void methodA() { LOG.debug("foo"); } @RequestMapping("/b") void methodB() { LOG