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

Missing @Lp annotation results in logging of all parameters #2

Open
Hervian opened this issue Jul 5, 2018 · 3 comments
Open

Missing @Lp annotation results in logging of all parameters #2

Hervian opened this issue Jul 5, 2018 · 3 comments

Comments

@Hervian
Copy link

Hervian commented Jul 5, 2018

Hi

How does one achieve logging of a method, but with no method parameters logged? I am only interested in logging that we are now entering method X and exiting method X.

I was hoping that one could simply avoid to annotate any method parameters with @lp, but it seems that no @lp annotation causes all parameters to be logged. I see that there are test cases, which specifically asserts this behavior so I assume that this is not a bug but intended behavior.

(To achieve what I would like one would probably have to delete the conditional empty check (and content of the scope) on the BitSet called lpParameters in the method: ArgumentDescriptor.Builder.build())

@nickvl
Copy link
Owner

nickvl commented Jul 5, 2018

Hi, that's right, if there is no at least a single @lp annotation then all parameters are added in a log record. It is possible to change this behavior only via source code modification.

@Hervian
Copy link
Author

Hervian commented Aug 15, 2018

Ok, thanks.
Another question: I can only get the logging to work on endpoints, not on regular methods. Shouldn't the AOP weave logging into all public methods annotated with fx @LogInfo? Or is the AOPLogger somehow defined to only add logging to spring rest endpoints?

@nickvl
Copy link
Owner

nickvl commented Aug 15, 2018 via email

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

No branches or pull requests

2 participants