Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.12
    • Component/s: * Cocoon Core
    • Labels:
      None
    • Other Info:
      Patch available

      Description

      Attached are two classes allowing to use SLF4J as logging facade inside Cocoon.
      1. Slf4jLoggerManager.java
        3 kB
        Laurent Medioni
      2. SLF4JLoggerManager.java
        2 kB
        Cédric Damioli
      3. SLF4JLogger.java
        3 kB
        Cédric Damioli

        Activity

        David Crossley made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        David Crossley added a comment -
        Add SLF4J to lib/jars.xml (otherwise the build intentionally fails).

        Now done in r1417273
        Show
        David Crossley added a comment - Add SLF4J to lib/jars.xml (otherwise the build intentionally fails). Now done in r1417273
        Hide
        Cédric Damioli added a comment -
        Thank you for the hint. I'll add it immediately.
        Any other step I could have forgotten ?
        Show
        Cédric Damioli added a comment - Thank you for the hint. I'll add it immediately. Any other step I could have forgotten ?
        David Crossley made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        David Crossley added a comment -
        Need to also add its license file to the "legal" directory as is done for other dependencies.
        Show
        David Crossley added a comment - Need to also add its license file to the "legal" directory as is done for other dependencies.
        Cédric Damioli made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Cédric Damioli added a comment -
        My mistake. I was focused on splitting sources from libs and forgot to commit that one.
        Committed slf4j-api in revision 1416633
        Show
        Cédric Damioli added a comment - My mistake. I was focused on splitting sources from libs and forgot to commit that one. Committed slf4j-api in revision 1416633
        David Crossley made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        David Crossley added a comment -
        Need to add the new dependency to lib/core directory. Currently getting errors with ./build.sh
        Show
        David Crossley added a comment - Need to add the new dependency to lib/core directory. Currently getting errors with ./build.sh
        Cédric Damioli made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Cédric Damioli added a comment -
        Committed in revision 1414669

        I've taken your patch, without inner classe and without "cocoon" prefix, to be consistent with other implementations
        Thanks !
        Show
        Cédric Damioli added a comment - Committed in revision 1414669 I've taken your patch, without inner classe and without "cocoon" prefix, to be consistent with other implementations Thanks !
        Cédric Damioli made changes -
        Fix Version/s 2.1.12-dev (Current SVN) [ 12312903 ]
        Hide
        Cédric Damioli added a comment -
        I don't know if there will ever be a 2.1.13, so let's include this in 2.1.12...
        Show
        Cédric Damioli added a comment - I don't know if there will ever be a 2.1.13, so let's include this in 2.1.12...
        Hide
        Laurent Medioni added a comment -
        Yes, same for inner classes :)
        There are a few differences for logger naming and chaining but maybe specific to our usage...
        This class has been validated in production since a few years now with a Logback.
        No hurry for 2.1.12 but something interesting to get out of the Avalon Logger ghetto :)
        Show
        Laurent Medioni added a comment - Yes, same for inner classes :) There are a few differences for logger naming and chaining but maybe specific to our usage... This class has been validated in production since a few years now with a Logback. No hurry for 2.1.12 but something interesting to get out of the Avalon Logger ghetto :)
        Hide
        Cédric Damioli added a comment -
        I prefer not use inner classes, but yes, both approaches are equals
        Do you want this ticket to be included as part of the 2.1.12 ?

        Show
        Cédric Damioli added a comment - I prefer not use inner classes, but yes, both approaches are equals Do you want this ticket to be included as part of the 2.1.12 ?
        Laurent Medioni made changes -
        Attachment Slf4jLoggerManager.java [ 12554830 ]
        Hide
        Laurent Medioni added a comment -
        Attached our own version of an SLF4J Logger Manager. Slightly different implementation but overall goal is the same...
        Show
        Laurent Medioni added a comment - Attached our own version of an SLF4J Logger Manager. Slightly different implementation but overall goal is the same...
        Cédric Damioli made changes -
        Fix Version/s 2.1.12-dev (Current SVN) [ 12312903 ]
        Hide
        Cédric Damioli added a comment -
        Indeed, the goal is to use logback, which is IMHO more featured than log4j
        And you're right, we previously used log4j and the avalon bridge was perfectly ok.

        Another reason is that the logging Avalon facade will probably never evolve whereas SLF4J will certainly do.
        Many other Apache projects are SLF4J compliant (we also use Jackrabbit and they will certainly go to logback by default as well).
        Show
        Cédric Damioli added a comment - Indeed, the goal is to use logback, which is IMHO more featured than log4j And you're right, we previously used log4j and the avalon bridge was perfectly ok. Another reason is that the logging Avalon facade will probably never evolve whereas SLF4J will certainly do. Many other Apache projects are SLF4J compliant (we also use Jackrabbit and they will certainly go to logback by default as well).
        Hide
        Ralph Goers added a comment -
        Not that there is anything wrong with your code, but it does seem a bit strange to have a logging facade - the Avalon Logger interface - call another facade - SLF4J. However, if you want to use Logback as your implementation that is the only way that is supported. SLF4J really isn't need to allow the Avalon Logger to bridge to Log4j, or java.util.logging.
        Show
        Ralph Goers added a comment - Not that there is anything wrong with your code, but it does seem a bit strange to have a logging facade - the Avalon Logger interface - call another facade - SLF4J. However, if you want to use Logback as your implementation that is the only way that is supported. SLF4J really isn't need to allow the Avalon Logger to bridge to Log4j, or java.util.logging.
        Hide
        Cédric Damioli added a comment - - edited
        I personnally use 1.5.3 in my project, but I've tested with the latest 1.5.11 without any problem
        Show
        Cédric Damioli added a comment - - edited I personnally use 1.5.3 in my project, but I've tested with the latest 1.5.11 without any problem
        Hide
        Jasha Joachimsthal added a comment -
        Cédric, which version of slf4j-api.jar did you use?
        Show
        Jasha Joachimsthal added a comment - Cédric, which version of slf4j-api.jar did you use?
        Cédric Damioli made changes -
        Field Original Value New Value
        Attachment SLF4JLogger.java [ 12440873 ]
        Attachment SLF4JLoggerManager.java [ 12440874 ]
        Hide
        Cédric Damioli added a comment -
        note that this classes depends on slf4j-api.jar, which has to be added to cocoon dependencies
        Show
        Cédric Damioli added a comment - note that this classes depends on slf4j-api.jar, which has to be added to cocoon dependencies
        Cédric Damioli created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Cédric Damioli
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development