config-magic icon indicating copy to clipboard operation
config-magic copied to clipboard

downgrade logging from INFO to DEBUG or TRACE

Open whoschek opened this issue 12 years ago • 4 comments

Thanks for such a handy library - very useful!

The default log level in logging libs such as logback and log4j is INFO. This implies that by default the logger.info() calls in ConfigurationObjectFactory generate tons of distracting log messages on output. It seems to me folks only want to see those message only in debug or trace mode, and not by default. Having to switch this off manually (ala opt out) seems counter intuitive to me.

whoschek avatar May 09 '12 19:05 whoschek

Choosing INFO was a conscious choice because it ensures that the information required for debugging a problem usually was caught in the log file. Not logging the config settings makes post mortem debugging harder.

hgschmie avatar May 09 '12 21:05 hgschmie

I think that's what the DEBUG level is intended for, conceptually. If all third party libs would log.info() in debug related places there'd be a sea of distractions in everyone's log files.

Anyway, I can manually work around it. Just thought I'd mention it.

whoschek avatar May 10 '12 18:05 whoschek

I don't think standard processing should cause any logging: if and when configuration values are to be called, calling application should request those to be logged in my opinion, not just expect them to be produced by side effect. If there are any errors, failures or possible conflicts, those are different matter.

Although I guess I can see the optional need to trace through assignment process wrt defaults, beyond ability to list final results.

cowtowncoder avatar Mar 01 '13 22:03 cowtowncoder

While I agree that standard processing should not be noisy, particularly from libraries, I have needed the config output on occasions :-/

brianm avatar Mar 15 '13 19:03 brianm