etaoin

valtteri 2018-07-08T19:08:44.000007Z

Hello, etaoin is awesome but how can I make it silent? It’s now shouting everything out on debug level. I mean, I’m getting tons of this when I run lein test.

18-07-08 19:02:07 d0513dd7b56a DEBUG [etaoin.client:288] - chrome-headless headless-chrome:4444   POST session/3a54b9e4007f03a334516a93962b437f/element {:using "xpath", :value ".//*[@id=\"account-btn\"]"}

valtteri 2018-07-08T19:09:49.000014Z

I already figured out that etaoin uses clojure/tools.logging which uses log4j which is configured by putting log4j.properties under resources/ which I’ve done but no effect.

valtteri 2018-07-08T19:10:27.000005Z

I’ve probably understood or done something wrong

valtteri 2018-07-08T19:13:46.000075Z

My resources/log4j.properties looks like this:

log4j.rootLogger=INFO, console
log4j.logger.etaoin=INFO
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p %c: %m%n
I have quite limited understanding what comes to configuring java loggers, so all help is appreciated. 🙂

valtteri 2018-07-08T19:16:13.000032Z

I don’t have :resource-paths entry in project.clj, so I guess it falls back to defaults. I can see resources folder when I run lein classpath

valtteri 2018-07-08T19:20:46.000004Z

Hmmm I don’t actually see log4j in lein classpath so my earlier assumption is probably false

valtteri 2018-07-08T19:24:58.000018Z

But I see org/clojure/tools.logging in classpath

valtteri 2018-07-08T19:25:02.000048Z

I’m confused

valtteri 2018-07-08T19:26:15.000009Z

https://github.com/clojure/tools.logging#usage this tells me to configure log4j with the property file as I did. However I’m not sure what is controlling the logging now. Maybe I need to sleep over this and take a fresh look in the morning. 🙂