Weird logging dependencies in core

30 views
Skip to first unread message

Mirko Friedenhagen

unread,
Aug 29, 2015, 11:46:38 AM8/29/15
to jenkin...@googlegroups.com

Hello,

after the task scanner plugin was complaining about a missing log4j configuration file, I took a look at the included dependencies in the war and found:

- commons-logging
- log4j
- slf4j-api
- slf4j-jd14

This is a weird mixture:
- everything using the slf4j-api will use the standard two line java.util.logging.
- everything using commons-logging or log4j directly will use log4j and this one is not configured so either they show up in the console output or are redirected to stderr or are lost in the dark.

I propose we mark log4j and commons-logging as provided and add log4j-over-slf4j and jcl-over-slf4j as runtime or compile dependencied so everything will use java.until.logging in the end.

What do you think?

Regards
Mirko
--
Sent from my mobile

Mirko Friedenhagen

unread,
Sep 1, 2015, 5:30:00 AM9/1/15
to jenkin...@googlegroups.com
Hello,

before creating a pull request I would like to get feedback whether I
am the only one who thinks this logging mixture strange :-).

Regards
Mirko
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/

Daniel Beck

unread,
Sep 1, 2015, 7:07:37 AM9/1/15
to jenkin...@googlegroups.com
Hasn’t core PR 1765 already addressed parts of this a few weeks ago?
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAK8jvqxj9Oxz69SLqUcTXipdVv7C1kasdqQYr5%2BddR6fu5kd_g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

James Nord

unread,
Sep 1, 2015, 11:54:49 AM9/1/15
to Jenkins Developers, m...@beckweb.net
Hasn’t core PR 1765 already addressed parts of this

I Hope so.  The commons-logging (still?) needs replacing with the slf4j interceptor.

Mirko Friedenhagen

unread,
Sep 1, 2015, 12:37:54 PM9/1/15
to jenkin...@googlegroups.com
OK, I think I will open a PR. log4j and commons-logging should best be
set to provided as otherwise they may sneak in in the core as
transitive dependency and the plugin parent should probably get
something like this as well.
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/cfbf6443-ec65-4843-b8dd-7bed2604118b%40googlegroups.com.

Mirko Friedenhagen

unread,
Sep 1, 2015, 4:50:50 PM9/1/15
to jenkin...@googlegroups.com

Baptiste Mathus

unread,
Sep 1, 2015, 4:55:31 PM9/1/15
to jenkin...@googlegroups.com
How about also adding an enforcer rule to just forbid dependency on commons-logging? That's what I did on our internal /corporate/ pom to prevent logging hell.
I can issue the associated PR if there's likely some agreement about that. 


For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Mirko Friedenhagen

unread,
Sep 2, 2015, 1:20:26 AM9/2/15
to jenkin...@googlegroups.com

Hello Baptiste,

great suggestion, I just did this.

Regards
Mirko
--
Sent from my mobile

Reply all
Reply to author
Forward
0 new messages