You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Janne Jalkanen (JIRA)" <ji...@apache.org> on 2008/09/14 23:57:44 UTC

[jira] Created: (JSPWIKI-376) Move from log4j to slf4j

Move from log4j to slf4j
------------------------

                 Key: JSPWIKI-376
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
             Project: JSPWiki
          Issue Type: Improvement
          Components: Core & storage
            Reporter: Janne Jalkanen
             Fix For: 3.0


SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).

http://www.slf4j.org

The license is MIT/X11, so that's fine.

Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (JSPWIKI-376) Move from log4j to slf4j

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> The point I was making is that regardless of SLF4J's benefits, it is
> still Yet Another Jar File. Given that almost *all* of the software
> we are currently using in almost all of our projects (i.e., those
> based in Java) uses log4j, we don't really need any additional choice
> of logging system. log4j is very simple to set up and we've had no
> problem with it.

But the problem is that it does not work for a whole lot of other  
people.  While you can afford to ignore that feedback, some of us  
have to deal with it on a regular basis...

> You solicited feedback on the proposal so I have provided that  
> feedback.

So noted ;-).

> As I wrote, I would much prefer we keep things simpler rather than  
> not,
> as JSPWiki's code base is getting remarkably more complicated as we
> move to 3.0.

Actually, I think it's going to be simpler than 2.8... We'll have  
more clean separation between the repository and the rendering.   
Stripes allows us to get rid of the Command superstructure (and  
replace it with a simple-to-understand ActionBean structure).  The  
API will make things more stable.

> It's not the friendly little software package it was a
> few years ago.

Well... All of our previous versions are still available ;-)

/Janne

Re: [jira] Created: (JSPWIKI-376) Move from log4j to slf4j

Posted by Murray Altheim <mu...@altheim.com>.
Janne Jalkanen wrote:
[...]
>> I would much prefer that we stay with log4j, as this is for myself
>> only an added complexity, an added redundancy, with little benefit.
> 
> Mmmm... I suspect you didn't read SLF4J documentation, which I highly 
> recommend.
> 
> It is a front-end against several logging systems - and will work 
> together seamlessly with log4j as well.  If log4j is your choice, the 
> change should be quite invisible for you (with the exception that 
> configuration *might* need to move to a separate file - which isn't 
> necessarily a bad thing, since our configuration is already somewhat 
> bloated).  If it's not, then JSPWiki unfortunately at the moment cannot 
> give you a choice for your logging system.  Considering that the log4j 
> issue with some containers seems to pop up every now and then, I'd say 
> that this is a low-hanging fruit which we can solve rather easily.

The point I was making is that regardless of SLF4J's benefits, it is
still Yet Another Jar File. Given that almost *all* of the software
we are currently using in almost all of our projects (i.e., those
based in Java) uses log4j, we don't really need any additional choice
of logging system. log4j is very simple to set up and we've had no
problem with it.

You solicited feedback on the proposal so I have provided that feedback.
As I wrote, I would much prefer we keep things simpler rather than not,
as JSPWiki's code base is getting remarkably more complicated as we
move to 3.0. It's not the friendly little software package it was a
few years ago. Obviously much of the changes are very welcome but I
hasten to point out that every time we make things more flexible we
also make them more complicated for somebody. Continuing to use log4j
is simply no problem for us -- we have no issues with it and would
prefer to keep using it. [E.g., for some of our projects I also was
quite happy with cvs and ant but am now forced to use svn and maven for
a lot of things, with very little if any added benefit).

> Also, I *highly* recommend that you add to the JIRA instead of posting 
> to the mailing list.  In a few months when the issue is discussed again, 
> it is unlikely that people will remember your comments from the mailing 
> list. :-)

Will do, thanks.

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

Re: [jira] Created: (JSPWIKI-376) Move from log4j to slf4j

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> While this may provide some benefits and be more flexible, it would
> require that in every single instance of our use of JSPWiki (which
> now reaches into three or four related projects) we would then have
> two logging systems. Log4J, whatever its issues, is still by far the
> most widely used Java-based logging package (so far as I know). It's
> functional and works well. It is widely understood by our programmers
> and contractors.
>
> We have no issue with log4j in any of our other projects (where it
> is used very widely), don't have any problems with it "playing well
> with other applications", and newness or coolness really doesn't
> enter into the decision-making process if that's the motivation.
>
> I would much prefer that we stay with log4j, as this is for myself
> only an added complexity, an added redundancy, with little benefit.

Mmmm... I suspect you didn't read SLF4J documentation, which I highly  
recommend.

It is a front-end against several logging systems - and will work  
together seamlessly with log4j as well.  If log4j is your choice, the  
change should be quite invisible for you (with the exception that  
configuration *might* need to move to a separate file - which isn't  
necessarily a bad thing, since our configuration is already somewhat  
bloated).  If it's not, then JSPWiki unfortunately at the moment  
cannot give you a choice for your logging system.  Considering that  
the log4j issue with some containers seems to pop up every now and  
then, I'd say that this is a low-hanging fruit which we can solve  
rather easily.

Also, I *highly* recommend that you add to the JIRA instead of  
posting to the mailing list.  In a few months when the issue is  
discussed again, it is unlikely that people will remember your  
comments from the mailing list. :-)

/Janne

Re: [jira] Created: (JSPWIKI-376) Move from log4j to slf4j

Posted by Murray Altheim <mu...@altheim.com>.
Janne Jalkanen (JIRA) wrote:
> Move from log4j to slf4j
> ------------------------
> 
>                  Key: JSPWIKI-376
>                  URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>              Project: JSPWiki
>           Issue Type: Improvement
>           Components: Core & storage
>             Reporter: Janne Jalkanen
>              Fix For: 3.0
> 
> 
> SLF4J allows far more flexible logging than log4j, and it would
> allow us to get rid of these dumb log4j compatibility problems
> that sometimes occur.  It also plays better with other
> applications, gives the user more power to choose how to log 
> his stuff, and is also pretty cool otherwise. The change would
> be relatively trivial, and would probably be largely invisible
> to the users (since we could continue shipping with necessary
> log4j jars).
> 
> http://www.slf4j.org
> 
> The license is MIT/X11, so that's fine.
> 
> Opinions?

While this may provide some benefits and be more flexible, it would
require that in every single instance of our use of JSPWiki (which
now reaches into three or four related projects) we would then have
two logging systems. Log4J, whatever its issues, is still by far the
most widely used Java-based logging package (so far as I know). It's
functional and works well. It is widely understood by our programmers
and contractors.

We have no issue with log4j in any of our other projects (where it
is used very widely), don't have any problems with it "playing well
with other applications", and newness or coolness really doesn't
enter into the decision-making process if that's the motivation.

I would much prefer that we stay with log4j, as this is for myself
only an added complexity, an added redundancy, with little benefit.

-1

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652304#action_12652304 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Yes, the ReleaseNotes should document these gotchas.

Especially since you need to put log4j.properties in /WEB-INF/classes, not just /WEB-INF/ (which took *me* a while to figure out ;-)

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652446#action_12652446 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------

SLF4J already has support for parameterized logging [1, 2].  So  com.ecyrd.jspwik.log.LoggerImpl duplicates an existing functionality but using a different convention. Message formatting in java.lang.String is more flexible but also much slower than SLF4J's implementation. So you will be roughly doubling the cost of an enabled log statement. Going through an indirection (LoggerImpl) will also roughly double the cost of a disabled log statement.

As for serialization, well, com.ecyrd.jspwik.log.LoggerImpl is not serializable. So, if you have objects placed in an HttpSesison which refer to loggers as instance variables, then Tomcat will have trouble with clustering. 

As for logger selectors, all wrappers ruin context selector functionality. Admittedly, the slf4j-log4j binding, since it is not native, already breaks repository selectors (aka context selectors). However, if logback were used as the underlying implementation, context selectors work as they should. They won't with jspwik.log.LoggerImpl. 

If you have further questions, please post them on the user@slf4j.org mailing list.

HTH,

[1] http://www.slf4j.org/manual.html
[2] http://www.slf4j.org/faq.html#logging_performance

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652283#action_12652283 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

BTW, I'm keeping this issue open, because we still need some extra code to deregister the Logging MBeans when JSPWiki is stopped.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harry Metske updated JSPWIKI-376:
---------------------------------

    Priority: Minor  (was: Major)

Lowering priority because it seems to introduce more potential problems (especially non-core plugins) than it might solve.
Only WebLogic users seem to be affected (not sure if it is true for the current release).
Any feedback from WebLogic users are appreciated, for now let's "freeze" this issue.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652457#action_12652457 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Oops, but we can add the "implements Serializable".  Looks like a simple oversight ;-)

I don't think performance is a bottleneck, and as you point out in the encoded documentation, evaluating the log level is < 1% of the actual cost of logging (some other email from you says it's 25ns for log4j and 10ns for logback).  So by wrapping the code in isDebugEnabled() prior to invoking String.format(), I think we're fine.

The Java String.format() is standard, and therefore familiar to developers.  It also means that we're not tied to slf4j in the future, in case need arises to replace it with something else.

The slf4j manual or faq do not mention anything about avoiding wrappers...  Is it not logback's fault then?  (Frankly, I still don't understand what the problem is unless you're looking at the call stack somehow, but I couldn't find anything relating to it in the code).

I would expect that in the future we would add localized logging through the use of implementing something like Logger.localizedInfo( String messagekey, Object... args );


> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642101#action_12642101 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

We'll have to bring slf4j in anyway if we move to jabsorb (JSPWIKI-276).  So after that we'll have *four* logging packages in use at the same time: log4j, slf4j, java.util.logging and apache commons logging, all from different dependencies.

Moving to a single logging system is starting to sound good...

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648005#action_12648005 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------

Hello Harry, Janne,

The SLF4J FAQ discusses this issue. Quoting from the FAQ [1], SLF4J is
only a facade, meaning that it does not provide a complete logging
solution. Operations such as configuring appenders or setting logging
levels cannot be performed with SLF4J. Thus, at some point in time,
any non-trivial application will need to directly invoke the
underlying logging system. In other words, complete independence from
the API underlying logging system is not possible for a stand-alone
application. Nevertheless, SLF4J reduces the impact of this dependence
to near-painless levels.

Still quoting the FAQ [1], suppose that your CRM application uses
log4j for its logging. However, one of your important clients request
that logging be performed through JDK 1.4 logging. If your application
is riddled with thousands of direct log4j calls, migration to JDK 1.4
would be a long and error-prone process. Had you been invoking SLF4J
API instead of log4j, the migration could be completed in a matter of
minutes instead of hours.

SLF4J lets component developers to defer the choice of the logging
system to the end-user but eventually a choice needs to be made.

One more thing. I wrote the log4j MBeans code. It's one of the more
sophisticated pieces of code in log4j. However, from a
user-friendliness point of view it is not worth the electrons it's
written on. I am sure you can do much better in JSPWiki. But I am
digressing.

At present time, SLF4J is a reasonable choice as a logging API but
they are other valid choices. In the case of JSPWiki, I would not
waste too much time about worrying logging. The success of JSPWiki
does not hinge on it. I hope you don't mind my unsolicited advice.

[1] http://slf4j.org/faq.html#when

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631907#action_12631907 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

I'm trying to imagine how this all works on the "problem" AppServers like WebSphere and JBoss.
If we keep shipping log4j.jar in WEB-INF/lib like we do now, I doubt that the classloading issues will be gone.
If that is the case, then deploying JSPWiki on WebSphere or JBoss still requires some shuffling of jar files around (which is no different than now).

Since solving the classloading issue was the primary reason for introducing slf4j, we should first know for sure if this can be solved and how.
I can do some investigation on this (unless somebody already know the answers off course)

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642495#action_12642495 ] 

Jürgen Weber commented on JSPWIKI-376:
--------------------------------------

> encapsulate logging in a single package: org.apache.jspwiki.log.Logger. 
> That can then act as a facade to slf4j. 

Which is a facade for java.util.logging which can be used as a facade for another logging framework which can be used as a facade for yet another framework which ....

Cool.



> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642458#action_12642458 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

At the very least we should probably encapsulate logging in a single package: org.apache.jspwiki.log.Logger.  That can then act as a facade to slf4j.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652376#action_12652376 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------

Hello all,

Just had a cursory look at [1].

LoggerImpl has a slightly different interface than org.slf4j.Logger with different syntax for message formatting. It lacks support for markers. Moreover, every org.slf4j.Logger instance is wrapped by com.ecyrd.jspwik.log.LoggerImpl which will break logger selector (or repository selector) functionality [2],not to mention serialization. 

I think that you are making things unnecessarily complicated for yourself. 

[1]  http://tinyurl.com/5unw49
[2] http://logback.qos.ch/snapshot/manual/loggingSeparation.html


> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631902#action_12631902 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

...actually, we could just check if log4j exists in the path and call PropertyConfigurator the old way.  Since it's a static object, it would configure the whole log4j anyway.  Should work transparently...

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646112#action_12646112 ] 

Craig Russell commented on JSPWIKI-376:
---------------------------------------

To future-proof your code, I'd recommend abstracting the logging used by jspwiki to a single set of interfaces used by each component, and a factory class that returns an instance of the logging interface. As long as you include in the interface all of the functionality needed, if you want to add another kind of logger you just need to update the factory and write a small adapter class. If some strange environment gives you a problem, there's just the adapter class that needs to be updated or a new adapter added.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642785#action_12642785 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Actually, there *is* a good need for a custom Logger implementation even with j.u.l - varargs (java.util.logging does not work with varargs).  Stripes does this.

Another problem with j.u.l is that a single configuration file controls *all* logging.  So if you have multiple jspwiki instances, you can't control logging per application.

Your arguments are convincing me even more that we should write our own facade...

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658309#action_12658309 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

I think this one is fixed now, isn't it?

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652282#action_12652282 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

Should we put something in the ReleaseNotes for this ? 
(It's only of interest to the jspwiki admin, not the jspwiki user)

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642257#action_12642257 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

The point being that at least slf4j allows everyone to choose which logging package they use...  But it's kinda odd to have to carry a generic logging library and not use it.

Especially since the addition of a bunch of new jars is necessary if we choose to take the jabsorb library.

BTW, OSCache will go away in 3.0, and be replaced by EhCache (which uses java.util.logging from 1.6 onwards).

Stripes uses... I don't know what Stripes uses.  They seem to fluctuate between slf4j, commons-logging and log4j.

Jackrabbit uses slf4j.  Also a number of other major projects (like Hibernate) are moving to slf4j...

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harry Metske updated JSPWIKI-376:
---------------------------------

    Attachment: jspwiki-log.odp

I tried to visualize how all things should work together, comments are welcome.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
Murray, please add your comments to the JIRA, if that is where the  
discussion are happening, so that we have a log of opinions.  In the  
end, once decision needs to be made, all the relevant opinions should  
be a part of the JIRA entry.  If this is looked at again half a year  
from now, I don't think anyone can be expected to go through the  
entire mailing list archive to find all the comments on an issue.   
Especially if it is done by someone who was not a part of the  
developer list at that time.

/Janne

On 27 Sep 2008, at 23:52, Murray Altheim wrote:

> Harry Metske (JIRA) wrote:
>>     [ https://issues.apache.org/jira/browse/JSPWIKI-376? 
>> page=com.atlassian.jira.plugin.system.issuetabpanels:comment- 
>> tabpanel&focusedCommentId=12635180#action_12635180 ] Harry Metske  
>> commented on JSPWIKI-376:
>> --------------------------------------
>> I did some further investigation last week on this, the details  
>> can be found at http://www.computerhok.nl/JSPWiki/Wiki.jsp? 
>> page=Slf4j.
>> To summarize:
>> - WebSphere version 6.1 and up no longer has a problem with  
>> JSPWiki, it installs out of the box (it appears that the common- 
>> logging-api.jar is no longer in WebSphere's lib directory, which  
>> was the root cause of the classloading problems)
>> - I don't have a WebLogic at my disposal, so I don't know if the  
>> current version of this still has the problem.
>> - If we switch to slf4j (which is not quite trivial), and we only  
>> ship the slf4j-simple.jar by default, we have to realize that all  
>> non-core plugins should also be changed so they also use slf4j.
>> After all I 'm not so sure if switching to slf4j is a good idea.  
>> My assumption is that the vast majority runs on Tomcat, and only a  
>> few run on WebLogic.
>> Switching to slf4j might break more things than it tries to repair.
>> I have a slf4j-simple based build running om Tomcat now, it passes  
>> all tests, but still a lot of things need to be adjusted (see link  
>> above).
>> How to continue? , opinions please....
>
> Hi Harry,
>
> I'm still opposed to this as unnecessary and an additional level
> of complexity. I'm also a maintainer of a great deal of code that
> uses log4j and I have no intention of switching that over to
> slf4j. This includes several libraries and several dozen plugins.
> On top of that I've got about 180K lines of code that use log4j.
>
> Changes that very significantly break existing classes without a
> very strong requirement should be frowned upon -- the amount of
> work to migrate to the Apache namespace and the changes planned
> for 3.0 are going to be a lot of work as it is. I can only speak
> for myself but I'm going to have enough trouble keeping up without
> things like slf4j migrations.
>
> Log4j works fine and I would hope we could concentrate on more
> important things.
>
> Murray
>
> ...................................................................... 
> .....
> Murray Altheim <murray07 at altheim.com>                            
> ===  = =
> http://www.altheim.com/murray/                                      
> = =  ===
> SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk                
> = =  = =
>
>       Boundless wind and moon - the eye within eyes,
>       Inexhaustible heaven and earth - the light beyond light,
>       The willow dark, the flower bright - ten thousand houses,
>       Knock at any door - there's one who will respond.
>                                       -- The Blue Cliff Record


Re: [jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by Murray Altheim <mu...@altheim.com>.
Harry Metske (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635180#action_12635180 ] 
> 
> Harry Metske commented on JSPWIKI-376:
> --------------------------------------
> 
> I did some further investigation last week on this, the details can be found at http://www.computerhok.nl/JSPWiki/Wiki.jsp?page=Slf4j.
> To summarize:
> - WebSphere version 6.1 and up no longer has a problem with JSPWiki, it installs out of the box (it appears that the common-logging-api.jar is no longer in WebSphere's lib directory, which was the root cause of the classloading problems)
> - I don't have a WebLogic at my disposal, so I don't know if the current version of this still has the problem.
> - If we switch to slf4j (which is not quite trivial), and we only ship the slf4j-simple.jar by default, we have to realize that all non-core plugins should also be changed so they also use slf4j.
> 
> After all I 'm not so sure if switching to slf4j is a good idea. My assumption is that the vast majority runs on Tomcat, and only a few run on WebLogic.
> Switching to slf4j might break more things than it tries to repair.
> 
> I have a slf4j-simple based build running om Tomcat now, it passes all tests, but still a lot of things need to be adjusted (see link above).
> 
> How to continue? , opinions please....

Hi Harry,

I'm still opposed to this as unnecessary and an additional level
of complexity. I'm also a maintainer of a great deal of code that
uses log4j and I have no intention of switching that over to
slf4j. This includes several libraries and several dozen plugins.
On top of that I've got about 180K lines of code that use log4j.

Changes that very significantly break existing classes without a
very strong requirement should be frowned upon -- the amount of
work to migrate to the Apache namespace and the changes planned
for 3.0 are going to be a lot of work as it is. I can only speak
for myself but I'm going to have enough trouble keeping up without
things like slf4j migrations.

Log4j works fine and I would hope we could concentrate on more
important things.

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635180#action_12635180 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

I did some further investigation last week on this, the details can be found at http://www.computerhok.nl/JSPWiki/Wiki.jsp?page=Slf4j.
To summarize:
- WebSphere version 6.1 and up no longer has a problem with JSPWiki, it installs out of the box (it appears that the common-logging-api.jar is no longer in WebSphere's lib directory, which was the root cause of the classloading problems)
- I don't have a WebLogic at my disposal, so I don't know if the current version of this still has the problem.
- If we switch to slf4j (which is not quite trivial), and we only ship the slf4j-simple.jar by default, we have to realize that all non-core plugins should also be changed so they also use slf4j.

After all I 'm not so sure if switching to slf4j is a good idea. My assumption is that the vast majority runs on Tomcat, and only a few run on WebLogic.
Switching to slf4j might break more things than it tries to repair.

I have a slf4j-simple based build running om Tomcat now, it passes all tests, but still a lot of things need to be adjusted (see link above).

How to continue? , opinions please....



> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647993#action_12647993 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

Log4j has them (I actually did some tests with it today, and registered all Log4j MBeans to the MBeanServer, and then dynamically adjusted the debuglevels with a jconsole, works perfect).
However, you cannot do this without bypassing the slf4j facade, and so you lose the independence of the underlying logsystem.
I don't know if the other logger implementations offer these nice MBeans, but it should be possible to offer these in slf4j and depending on the underlying logging system we should get MBean access or not.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642147#action_12642147 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

Remember that slf4j is just an abstraction layer (like commons-logging), so we still would have to choose a logging implementation, in my opinion this could be log4j or the standard JDK logging. 
My first impression is that log4j is still more flexible and feature rich than the standard JDK logging (but we an extra jar).

We can make JSPWiki itself use slf4j,  but what to do with the other packages we depend on, and that do not (yet) use slf4j ?
Might be a good idea to first summarize who these are, and if there are plans to migrate those to slf4j :
- jabsorb - slf4j (oke)
- JSPWiki - log4j (oke, we migrate it to slf4j ourselves)
- OSCache - commons-logging ?
- xmlrpc ?
- ...........a lot more..........

This might be a long run :-(

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647985#action_12647985 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Won't the individual slf4j implementations then expose their own MBeans?

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642103#action_12642103 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Besides, non-core plugins will have to be changed for 3.0 anyway, since the packages change.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642811#action_12642811 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

A few more pennies from my side :
I don't like a solution that does not support multiple logging configurations per JVM, that is absolutely unacceptable.
I would vote for slf4j with slf4j-log4j and jcl-over-slf4j, with or without an extra facade I don't care that much.
I also have a wish since very long to run with a dynamically configurable logging, so something like log4j's configureAndWatch().

regards,
Harry

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652438#action_12652438 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

We don't use markers, so that's fine.  As for the API, I think that the varargs API is a great benefit, as it makes logging code clearer.

I don't understand how that could possibly break the logger selector, or serialization?  It's just a class, and we pass the class name to the slf4j LoggerFactory directly.  Could you please provide concrete examples?

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652752#action_12652752 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------

Performance of both enabled and disabled log statements have significance. There mere introduction of an indirection via an additional interface adds cost to each method invocation. This impacts disabled log statements. 

For enabled log statements, as mentioned in my previous comment, message formatting in java.lang.String is more flexible but also much slower than SLF4J message formatting. So you will be roughly doubling the cost of *enabled* log statements.

If you are still interested in discussing this topic, please let us do so on user@slf4j.org.  

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by Murray Altheim <mu...@altheim.com>.
Janne Jalkanen wrote:
>> I've come out before against adding Yet Another Logging Package (YALP) to
>> our set of jar files, and while I'd still really prefer to avoid doing
>> that I thought I would offer support for going with java.util.logging, in
>> that if JSPWiki relied entirely on it I'd be willing (and relatively
>> happy) to go to the trouble of moving my own code over to that for the
>> same reasons as you state: I'd like to remove unnecessary dependencies
>> and reduce the overall weight of my installations. The redundancies of
>> the current situation are likewise frustrating.
> 
> Unfortunately, java.util.logging does not reduce our dependencies at 
> all.  Some external jars that we have require commons logging, some 
> require log4j, so we can't get rid of those.
> 
> Moving to jabsorb in preference of jsonrpc lib means that we have to 
> *add* another set of logging libraries, namely slf4j.
> 
> java.util.logging does not really help the situation at all (and in 
> fact, makes it worse, since j.u.l does not support multiple logging 
> configurations per jvm, which is pretty much a showstopper for my own 
> installations, for example.)

Janne,

Yes, in reading further along in the thread I have come to understand
this situation. Yuck. I looked over the j.u.l documentation to see if
there was perhaps some loophole but if there is it's not obvious; seems
there's one LogManager per JVM.

Sorry I have little else to add...

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

Re: [jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> I've come out before against adding Yet Another Logging Package  
> (YALP) to
> our set of jar files, and while I'd still really prefer to avoid doing
> that I thought I would offer support for going with  
> java.util.logging, in
> that if JSPWiki relied entirely on it I'd be willing (and relatively
> happy) to go to the trouble of moving my own code over to that for the
> same reasons as you state: I'd like to remove unnecessary dependencies
> and reduce the overall weight of my installations. The redundancies of
> the current situation are likewise frustrating.

Unfortunately, java.util.logging does not reduce our dependencies at  
all.  Some external jars that we have require commons logging, some  
require log4j, so we can't get rid of those.

Moving to jabsorb in preference of jsonrpc lib means that we have to  
*add* another set of logging libraries, namely slf4j.

java.util.logging does not really help the situation at all (and in  
fact, makes it worse, since j.u.l does not support multiple logging  
configurations per jvm, which is pretty much a showstopper for my own  
installations, for example.)

/Janne

Re: [jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by Murray Altheim <mu...@altheim.com>.
Janne Jalkanen (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642547#action_12642547 ] 
> 
> Janne Jalkanen commented on JSPWIKI-376:
> ----------------------------------------
> 
> Yeah, that's what you get when you have multiple logging packages, all
> incompatible, and all changing and/or abandoned, with the one that is
> a default is nigh useless.
> 
> A lot of projects (like Stripes) therefore use their own logging
> abstraction so that people can rewrite it if they want to.
> 
> Another possibility might be to switch to java.util.logging and simply
> get rid of all logging libraries.  But no, we can't do it because we
> have library dependencies to all sorts of strange logging libraries...
> 
> It's extremely frustrating.  With all my other projects, I'm just using
> the java builtin logging.  It may suck, but at least *I* won't be the
> one bringing in a dumb dependency to a logging library.

Hi Janne,

I've come out before against adding Yet Another Logging Package (YALP) to
our set of jar files, and while I'd still really prefer to avoid doing
that I thought I would offer support for going with java.util.logging, in
that if JSPWiki relied entirely on it I'd be willing (and relatively
happy) to go to the trouble of moving my own code over to that for the
same reasons as you state: I'd like to remove unnecessary dependencies
and reduce the overall weight of my installations. The redundancies of
the current situation are likewise frustrating.

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642547#action_12642547 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Yeah, that's what you get when you have multiple logging packages, all incompatible, and all changing and/or abandoned, with the one that is a default is nigh useless.

A lot of projects (like Stripes) therefore use their own logging abstraction so that people can rewrite it if they want to.

Another possibility might be to switch to java.util.logging and simply get rid of all logging libraries.  But no, we can't do it because we have library dependencies to all sorts of strange logging libraries...

It's extremely frustrating.  With all my other projects, I'm just using the java builtin logging.  It may suck, but at least *I* won't be the one bringing in a dumb dependency to a logging library.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642890#action_12642890 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------


> Actually, there is a good need for a custom Logger implementation even
> with j.u.l - varargs (java.util.logging does not work with
> varargs). Stripes does this.

SLF4J has support for parameterized logging statements which might be
what you are looking for.

> Another problem with j.u.l is that a single configuration file
> controls all logging. So if you have multiple jspwiki instances, you
> can't control logging per application.

This control problem applies to j.u.l. but no other logging library,
including jcl, slf4j and log4j.

> Your arguments are convincing me even more that we should write our
> own facade...

It's a wonderful free world. :-)

The downside of your own facade, is (slight) isolation from the rest of the
community. Developers will have a (slightly) harder time understanding JSPWiki
and getting into it. It is sometimes beneficial to raise the entry
barrier although logging may not be the best place to do so.

Anyway, logging is a controversial topic. I can only hope that the
JSPWiki community will reach a consensus without wasting too much
energy.


> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651741#action_12651741 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

Fixed in 3.0.0-svn-13 revision 721700.

        3 new classes in the new package com.ecyrd.jspwiki.log
        - LoggerFactory
        - Logger (interface)
        - LoggerImpl
        The LoggerFactory also takes care of registering DynamicMBeans if log4j is used as the underlying logging implementation.
        Log4j remains the default implementation (Stripes still needs it too) 
        Changes to 34 JSP's
        Changes to 135 Java classes
        Additions to WEB-INF/lib : slf4j-log4j12-1.5.6.jar, jul-to-slf4j-1.5.6.jar, jcl-over-slf4j-1.5.6.jar
        Removals from .classpath: commons-logging-api.jar, log4j-1.2.14.jar
        Additions to .classpath : slf4j-api-1.5.6.jar, jul-to-slf4j-1.5.6.jar
        Move log4j config statements from jspwiki.properties to log4j.properties
        Changes to build.xml (include org.apache.jspwiki in javadoc gen)
        A few other minor changes.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642483#action_12642483 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------

Hello,

I would like to point out that dependencies on commons-logging can be replaced by jcl-over-slf4j which is binary compatible with commons-logging 1.1.1 as well as 1.0.4. Such a move would have all logging go through SLF4J instead of SLF4J *and* JCL. Moreover, users deploying on Tomcat 5.5.x series would have much fewer problems when reloading JSPWiki.

Janne, if I could, I would discourage you from writing a facade for SLF4J which is a facade in itself. 

Please ping me on user@slf4j.org mailing list if you need help regarding your planned migration. 

HTH, 

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635182#action_12635182 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

If the new containers really have no problem anymore, then I agree, this may be less of a pain than before.  So perhaps the move is not urgent or useful at all.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648004#action_12648004 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Well, Ceki is watching this thread so I hope he'll give his own comments on this :-)

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631895#action_12631895 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

I think we only need the slf4j-api.jar during compile.  We can then ship with one of the implementation libraries, like log4j.  I don't think we should ship with any of the others.

I'm not sure how the configuration should run... That needs to be investigated more.  (log4j.properties is an option too.)

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Ceki Gulcu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649301#action_12649301 ] 

Ceki Gulcu commented on JSPWIKI-376:
------------------------------------

Hello Harry,

I think you have done a very good job synthesizing various logging paths in JSPWiki, and in Java more generally. It's not a very pretty sight.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631885#action_12631885 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

So, reading through the sl4j documentation I have the following notes/questions :
- We run the sl4j migrator and thereby do a mass change to our source code, and probably pick up some low hanging fruit by using formatted log messages ?
- Keep using log4j.jar during compile, and also include slf4j-api.jar ?
- Leave out log4j.jar in JSPWiki.war, and rely on each container's logging implementation ?  I guess this is necessary to eliminate the classloading issues ??
- Should we ship all slf4j binding files for the logging implementations (log4j, nop, simple, jdk14) in the war outside the classpath and let the person who deploys JSPWiki pick the right one and put it in the WEB-INF/lib ?  (an extra step for the deployer)
- How to configure the logging ?  Currently WikiEngine does a log4j PropertyConfigurator.doConfigure() , this is not supported by slf4j. For log4j it could simple be solved by adding a log4j.xml config file somewhere in the classpath. (Still no dynamic configuration possible :-( )


> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631922#action_12631922 ] 

Janne Jalkanen commented on JSPWIKI-376:
----------------------------------------

Good point.  Might make sense to ship with the simplelog.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harry Metske closed JSPWIKI-376.
--------------------------------

    Resolution: Fixed

Yes

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: jspwiki-log.odp
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647980#action_12647980 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

Another MAJOR disadvantage of using slf4j is that you will lose programmatic access to the Loggers.
This means you cannot dynamically change the loglevels via MBeans or some other means. This is really necessary if you want to debug problems in large scale wiki's where you cannot afford to turn on debugging and restart the wiki, or even run with higher debuglevels for more than a few seconds.
Maybe we can pursue Ceki to implement these kind of interfaces in slf4j ?

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642343#action_12642343 ] 

Harry Metske commented on JSPWIKI-376:
--------------------------------------

OK, it sounds to me that it makes sense to jump over to slf4j.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JSPWIKI-376) Move from log4j to slf4j

Posted by "Jürgen Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JSPWIKI-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642784#action_12642784 ] 

Jürgen Weber commented on JSPWIKI-376:
--------------------------------------

Here is a good argument in favour of j.u.l.: 
the comment of whartung on 
http://weblogs.java.net/blog/schaefa/archive/2007/08/to_the_hell_wit_1.html

Just take j.u.l. as a given in the JDK and if absolutely needed, write a logger to route to other implementations. So no need for jspwiki.log.Logger.

> Move from log4j to slf4j
> ------------------------
>
>                 Key: JSPWIKI-376
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-376
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage
>            Reporter: Janne Jalkanen
>            Assignee: Harry Metske
>            Priority: Minor
>             Fix For: 3.0
>
>
> SLF4J allows far more flexible logging than log4j, and it would allow us to get rid of these dumb log4j compatibility problems that sometimes occur.  It also plays better with other applications, gives the user more power to choose how to log his stuff, and is also pretty cool otherwise. The change would be relatively trivial, and would probably be largely invisible to the users (since we could continue shipping with necessary log4j jars).
> http://www.slf4j.org
> The license is MIT/X11, so that's fine.
> Opinions?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.