Enable SqlLogging by class/dao? #2412
-
We have dozens of "Dao" classes for type specific lookups (e.g. query Users, Floobles, etc). I'd like to enable logging for one of them while I'm debugging something, but it looks like Is there a way to be selective about what it logs? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Unfortunately I don't see a simple way to do this right now. If you have access to the |
Beta Was this translation helpful? Give feedback.
-
The context has a getExtensionMethod() on it. I'm using it to help augment my log line so I can grep for the class of interest. Works for local debugging, but would break down a bit in prod with just too much spew. It be useful to say "log everything from the NewFeatureThingExtension", but not log all the other extensions. Not sure what that looks like, a logger per extension somehow? A per extension annotation that says whether it should get logged? Food for thought anyway. |
Beta Was this translation helpful? Give feedback.
-
Oh, you're entirely right, how did I miss that! To implement that, can't you implement a logger that checks the extension class?
|
Beta Was this translation helpful? Give feedback.
-
I'll close this as answered - right now you have to write code to accomplish this. If there's desire for a more configuration-forward way to do it, we'd be happy to consider contributions to that effect. Thanks for the question! |
Beta Was this translation helpful? Give feedback.
Oh, you're entirely right, how did I miss that!
To implement that, can't you implement a logger that checks the extension class?