not really a 4k question but probable you've had t...
# http4k
not really a 4k question but probable you've had to deal with it: Trying to test my 4k server using the 4k
... which is stuck on "DEBUG" log level and thus prints huge amounts of output. Tried to change with
(LoggerFactory.getLogger( as ch.qos.logback.classic.Logger).level = Level.ERROR
but no luck. Any ideas on changing the client log level? Thanks.
OK, that line almost works. But you need to use a string name
rather than the class, and you MUST place it in its own function annotated with
(or just
Copy code
@Before fun setupLogging() {
  (LoggerFactory.getLogger("org.apache.http") as ch.qos.logback.classic.Logger).level = <http://Level.INFO|Level.INFO>
Ah logging - such a joy on the JVM! There's a reason that we just default to stdout... 🙂 .
I tend to add a
file to the test resources directory, with some some simple config to log to console at INFO level. That means I can control all logging in one place for all tests without having to do that in code.
👍 2