You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for this fantastic library, I am using it for logging in a Dropwizard service.
I think that @Loggable does not pick the package/class level if using Log4J2 in a Dropwizard service (and maybe also in other contexts).
I attach to this issue (jcabi-aspects-loggable-log2j2-level.zip) a simple Dropwizard example (built with Maven) service to reproduce the behaviour I experienced. The behaviour is the following:
as you can see the root log level is INFO, and I set a custom logger with a TRACE log level for the package "jcabi.aspects.loggable.log.level.api".
2. Set the log level of the @Loggable annotation to TRACE.
3. Run the service (e.g., with java -jar target/example.jar server configuration.yml), make a call on the defined API (e.g., using curl -X GET 127.0.0.1:8080/v1/example) and you are NOT going to see the Loggable logs.
Now:
Change the log4j2.yml file as follows, thus setting the root log level to TRACE, the same log level as the @Loggable annotation:
Run the service (e.g., with java -jar target/example.jar server configuration.yml), make a call on the defined API (e.g., using curl -X GET 127.0.0.1:8080/v1/example) and you are going to see the Loggable logs.
I think that Loggable is only picking the root log level settings, not the package/class log level.
Let me know if I can improve the explanation, and if you are aware of this issue and know how to solve it or I made some mistake in setting up Loggable in the service.
The text was updated successfully, but these errors were encountered:
Hi, thank you for this fantastic library, I am using it for logging in a Dropwizard service.
I think that
@Loggable
does not pick the package/class level if using Log4J2 in a Dropwizard service (and maybe also in other contexts).I attach to this issue (jcabi-aspects-loggable-log2j2-level.zip) a simple Dropwizard example (built with Maven) service to reproduce the behaviour I experienced. The behaviour is the following:
log4j2.yml
file:as you can see the root log level is
INFO
, and I set a custom logger with aTRACE
log level for the package"jcabi.aspects.loggable.log.level.api"
.2. Set the log level of the
@Loggable
annotation toTRACE
.3. Run the service (e.g., with
java -jar target/example.jar server configuration.yml
), make a call on the defined API (e.g., usingcurl -X GET 127.0.0.1:8080/v1/example
) and you are NOT going to see the Loggable logs.Now:
log4j2.yml
file as follows, thus setting the root log level toTRACE
, the same log level as the@Loggable
annotation:java -jar target/example.jar server configuration.yml
), make a call on the defined API (e.g., usingcurl -X GET 127.0.0.1:8080/v1/example
) and you are going to see the Loggable logs.I think that Loggable is only picking the root log level settings, not the package/class log level.
Let me know if I can improve the explanation, and if you are aware of this issue and know how to solve it or I made some mistake in setting up Loggable in the service.
The text was updated successfully, but these errors were encountered: