-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Labels
Description
I am using Flogger API to log details in my spring boot controller, I am using below dependency for logging:
<dependency>
<groupId>com.google.flogger</groupId>
<artifactId>flogger-slf4j-backend</artifactId>
<version>0.7.4</version>
</dependency>
I need to log caller details like class name, method name and line number. so, I have been using this log pattern in logback.xml file.
Class:%class{36} Method:%method Line:%line
With Fluent API:
log.atInfo().log(">>>>>>>>>>>>>>Test>>>>>>>>>>>>>>>>");
It logs:
"Class1":"c.g.c.f.b.slf4j.Slf4jLoggerBackend","Method1":"log","Line1":"176"
So, its logging internal details. Not the current Controller class or method name, which is DemoController and test method here.
However, It logs properly with @slf4j or with log.info and log.debug etc
Can anyone pls suggest how to log correct caller details with Flogger API.