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
Logging parameters is really handy and encourages writing good toString() methods, but when the parameters are very large collections of these objects, logging-interceptor toString()s each object.
It would be nice to optionally log collection types and sizes instead of the string of each object in the collection.
The text was updated successfully, but these errors were encountered:
Actually, yeah, that's where I'm seeing it most, on return values from JAX-RS endpoints.
I'm using MicroProfile Config in my apps, which is CDI-enabled and a fairly nice config system. Geronimo Config Impl is a handy implementation of MP Config.
I kinda think collection size logging should be on by default... but maybe there are options for turning it on or off or setting thresholds, etc.
MP Config is uber-cool! I hadn't thought of using it here, as everything else is configured statically in the code. Only the loggers are configured externally, and the interceptor doesn't know anything about that. Seems a bit oversized to use MP Config for only one aspect, doesn't it? Maybe extend the @DontLog annotation: @DontLog(moreThan=10). What do you think?
@DontLog seems like a little bit of a mismatch, since I still want logging, I just want less logging: name & count (variable name or type name [type name might be hard given generics erasure, unless you get anonymous null extensions that prevent erasure]).
Probably you're right, though, that an additional annotation could configure collections logging. The only down side is having to use it everywhere. If I could place the annotation at the package-info level, I would be satisfied with this approach.
Logging parameters is really handy and encourages writing good
toString()
methods, but when the parameters are very large collections of these objects, logging-interceptortoString()
s each object.It would be nice to optionally log collection types and sizes instead of the string of each object in the collection.
The text was updated successfully, but these errors were encountered: