I'm using a library that logs a bunch of stuff that I don't want to log. It's using java.util.logging
.
I also don't want to completely disable its logging since some of its logs are useful. Since the unwanted lines are logged only when I run a certain task, if there was a global way of disabling and enabling logging it would solve my problem.
Ideally something like:
disableLogging();
taskThatMakesUnnecessaryLogs();
enableLogging();
util.logging
, but why would you? – Dittoj.u.l
wasn't fine or thatlog4j
is the only option. I saidj.u.l
is not suited for this use-case. – Ditto