This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-07
Channels
- # aleph (19)
- # aws (1)
- # beginners (75)
- # boot (28)
- # cider (1)
- # cljs-dev (12)
- # cljsrn (20)
- # clojure (350)
- # clojure-argentina (1)
- # clojure-chicago (2)
- # clojure-dev (2)
- # clojure-russia (5)
- # clojure-spec (2)
- # clojure-uk (14)
- # clojure-ukraine (3)
- # clojurescript (68)
- # component (87)
- # core-async (25)
- # core-logic (13)
- # cursive (4)
- # data-science (72)
- # datascript (59)
- # datomic (15)
- # defnpodcast (7)
- # emacs (33)
- # hoplon (5)
- # immutant (73)
- # jobs (21)
- # klipse (6)
- # lumo (14)
- # off-topic (26)
- # om (23)
- # onyx (6)
- # parinfer (37)
- # protorepl (4)
- # re-frame (13)
- # ring (2)
- # rum (3)
- # spacemacs (2)
- # specter (22)
- # sql (47)
- # uncomplicate (10)
- # unrepl (79)
- # untangled (66)
- # vim (47)
- # yada (17)
afternoon channel. I’m having a pretty awful time trying to pump immutant logs through timbre. My deps are set up like so:
[com.taoensso/timbre "4.7.4"]
[org.slf4j/slf4j-api "1.7.21"]
[com.fzakaria/slf4j-timbre "0.3.5"]
[org.slf4j/log4j-over-slf4j "1.7.14"]
[org.immutant/web "2.1.5"
:exclusions [ch.qos.logback/logback-classic]]
With this I get logs from org.projectodd.wunderboss.web.Web
coming through timbre, but logs from xnio
and from when an error is thrown mid-request are sent in some default-looking format to stdout. If I add log4j-core
I get the same thing but in a slightly different format. Does anyone know the incantation to make this work? Google suggests it’s possible (https://twitter.com/statonjr/status/541250845300768768)Sure
Jun 06, 2017 6:21:51 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.6.Final
Jun 06, 2017 6:21:51 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.6.Final
if you comment out your timbre & logging deps (and just use the default) does the output from xnio change?
I can’t really comment out timbre as the app won’t boot, but with these:
[com.taoensso/timbre "4.7.4"]
;[org.slf4j/slf4j-api "1.7.21"]
;[com.fzakaria/slf4j-timbre "0.3.5"]
;[org.slf4j/log4j-over-slf4j "1.7.14"]
[org.immutant/web "2.1.5"
:exclusions [ch.qos.logback/logback-classic]]
I get
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
Jun 07, 2017 12:46:02 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.6.Final
Jun 07, 2017 12:46:02 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.6.Final
I’ve skimmed the source of xnio and see that it delegates to jboss for logging. Have also tried manually setting org.jboss.logging.provider
to both log4j
and slf4j
—makes no difference.
yeah, what's interesting is if you go with the default config, you don't see any messages from XNIO at startup
It’s to get it into a timbre appender function so that I can log to file/stdout/kibana and instrument error counts with riemann
jboss-logging is supposed to recognize that slf4j is available, and designate to that, but it looks like that's not happening
well interestingly, I do get this coming through timbre when I start the server:
INFO [org.projectodd.wunderboss.web.Web:145] - Registered web context /
yeah, that's from wunderboss, which doesn't use jboss-logging, and writes directly to slf4j
It’s odd that when I manually set jboss to use slf4j (have checked it is set properly) it doesn’t make a difference. Perhaps it’s not detecting log4j/slf4j but, in the absence of logback, is just writing directly to stdout
But when I include log4j I get errors about multiple bindings and a warning about a missing config file
I'm at a loss - @jcrossley3 should be in soon, he may have some more insight
weird. it's failing because something in clojure-land is throwing an AssertionError: "Assert failed: (nil? arg-array)", but with no stacktrace
i have no insight. i always defer to James Perkins for jboss logging problems.
@lorddoig I'm back. It looks like this the culprit: https://github.com/fzakaria/slf4j-timbre/tree/master/src/slf4j_timbre/adapter.clj#L95
it doesn't expect (and doesn't allow) the .log method to be called with an arg array, and that's happening somewhere
I think so, since jboss-logging fails to init slf4j (that assert fails when jboss-logging makes a debugf call to the slf4j logger it found during init, and jboss-logging swallows the exception and assumes slf4j failed to init, and moves on to other logging methods)
happy to help! though messages that come through that -log fn won't have the arg-array included in the message, it is just ignored
so this is something that should probably be fixed in slf4j-timbre for real at some point
I’ll fork for new and open an issue/PR. Unless you’re planning on doing that? you seem to know more than me
@tcrawley nice catch!
The team here at http://style.com are extremely grateful. Thanks so much guys.
@lorddoig you're welcome to file the issue and fix it if you like, and I'm happy to assist.
@tcrawley I’ve just tried commenting that assert out but I’m seeing the same thing happening. What deps are you using?