Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can @Loggable log exceptions at the configured log level? #149

Closed
jhansoty73 opened this issue Apr 8, 2015 · 10 comments
Closed

Can @Loggable log exceptions at the configured log level? #149

jhansoty73 opened this issue Apr 8, 2015 · 10 comments

Comments

@jhansoty73
Copy link

For a method annotated with @Loggable(Loggable.DEBUG) the method entry and exit messages use the configured log level, DEBUG in this case, but if the method throws an exception then a message gets logged at the ERROR level.

For an exception that propagates up a call stack, this will result in multiple ERROR logs. I really want the ERROR log, if needed, be generated by the code that eventually handles the exception.

For my use case it would be ideal if the exception logging honored the log level setting in @Loggable. Would this fix be of interest?

@dmarkov
Copy link

dmarkov commented Jun 15, 2015

@yegor256 please pay attention to this issue

@yegor256
Copy link
Member

@jhansoty73 yes, we should fix this, thanks

@broomzhang
Copy link

Hello @yegor256

First, thank you very much for your great work of this aspectj project, and it helped us a lot.
But I have also encountered this same log level issue, and it does impact the log heavily, so I hope this bug could be fixed.

Because I am new to aspect, I am not sure if I have found the real bug, but I hope my info could help.
It seems that at: com.jcabi.aspects.aj.MethodLogger.java line 231,
instead of "Loggable.ERROR", the log level should be something like annotation.value()

Hope this info will help to fix this bug, and thanks again for this great work.

yegor256 pushed a commit that referenced this issue Nov 5, 2015
@yegor256
Copy link
Member

yegor256 commented Nov 5, 2015

@rultor release, tag is 0.22.2

@yegor256
Copy link
Member

yegor256 commented Nov 5, 2015

@jhansoty73 @broomzhang I fixed it in a6d2021

@rultor
Copy link
Contributor

rultor commented Nov 5, 2015

@rultor release, tag is 0.22.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Nov 5, 2015

@rultor release, tag is 0.22.2

@yegor256 Done! FYI, the full log is here (took me 23min)

@yegor256
Copy link
Member

yegor256 commented Nov 5, 2015

@jhansoty73 @broomzhang try version 0.22.2

@broomzhang
Copy link

@yegor256 Thank you very much for your lightning fast fix.
the version 0.22.2 works perfectly now.

@yegor256
Copy link
Member

yegor256 commented Nov 5, 2015

@jhansoty73 please, close this ticket. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants