log4j complains

509 views
Skip to first unread message

ko...@tresata.com

unread,
Feb 8, 2015, 4:42:44 PM2/8/15
to drake-w...@googlegroups.com
i see log4j complaining about no appenders. is this expected?

$ drake --jobs 2
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Nothing to do.
drake:

now i realize this is maybe because i swapped out the hadoop dependencies, and i might have added some that have their own usage of log4j. but i also see log4j warnings from drake.core itself in certain situations:

$ drake --help
-w file-or-dir-name Name of the workflow file to execute; if a
< skipping lot more help output here >
--split-vars-regex=regex Specifies a regex to split up the --vars
argument (by default, a regex that splits on
commas except commas within double quotes).
log4j:WARN No appenders could be found for logger (drake.core).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


Alan Malloy

unread,
Feb 9, 2015, 3:00:49 PM2/9/15
to drake-w...@googlegroups.com, ko...@tresata.com
Drake uses clojure.tools.logging, which uses whatever logging backend you configure, the default one being simply to write to stdout (or maybe it's stderr? not sure). If you've changed the dependencies such that you're bringing in something that wants a log4j config, and you don't provide one, then things will break, including the existing log calls in drake itself. I don't think this is a drake-related problem, just a mismatch between your dependencies and your configuration.

Koert Kuipers

unread,
Feb 9, 2015, 3:03:04 PM2/9/15
to Alan Malloy, drake-w...@googlegroups.com
agreed, but what about:

log4j:WARN No appenders could be found for logger (drake.core).

Alan Malloy

unread,
Feb 9, 2015, 3:19:18 PM2/9/15
to drake-w...@googlegroups.com, al...@factual.com, ko...@tresata.com
That's just what I said. You set up a logger that wants to be configured, and didn't configure it. Since drake uses whatever logger you have set up, log calls from inside drake will also need to be configured (eg, by setting a default log4j appender, if log4j is what you are using).

Koert Kuipers

unread,
Feb 9, 2015, 3:23:03 PM2/9/15
to Alan Malloy, drake-w...@googlegroups.com
oh so just by adding the log4j jar drake will  automatically use it? i didnt realize.

i mean, i can see how i added the jar, but i by no means configured it to be used by clojure.tools.logging (you referred to whatever logging backend you configure for clojure.tools.logging).

Alan Malloy

unread,
Feb 9, 2015, 3:25:28 PM2/9/15
to drake-w...@googlegroups.com, al...@factual.com, ko...@tresata.com
Yes. See https://github.com/clojure/tools.logging/blob/master/src/main/clojure/clojure/tools/logging/impl.clj#L47-L224, which tries to find a logging library on your classpath and sets c.t.logging up to use it.

Koert Kuipers

unread,
Feb 9, 2015, 3:31:04 PM2/9/15
to Alan Malloy, drake-w...@googlegroups.com
got it thanks. i will simply have to configure log4j then by including a log4j.properties so it also sends everything to stderr or stdout.
Reply all
Reply to author
Forward
0 new messages