Velocity
  1. Velocity
  2. VELOCITY-392

Switch to a better log system - slf4j

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      Since I'm still very unhappy with the current logging workaround in velocity, I
      removed the complete velocity logsystem stuff and replaced it with slf4j (see
      http://slf4j.org/manual.html ; http://slf4j.org/faq.html). So, the final thing
      is a little bit smaller and should be wrt. logging easier to use (i.e. no need
      for passing runtime svc handles back and forth just to be able to log
      something), much faster, safer and more precise and powerful than the old one...

      In case your are interested, I'll attach the patch made against the saturday
      evening svn repository. It basically contains the log changes as well as some
      code cleaning (i.e. remove/comment out unsed vars/methods, removed unneccessary
      casts as well as nested else clauses, removed throw XExceptions, which are
      actually not thrown). Finally I switched many log.info into log.debug, since the
      appropriate messages are important for developers only and should not irritate
      the enduser (who usually doesn't even understand that freak language ).

      To get the thing running out of the box, I modified the buildfile to include
      log4j.properties in the jar, so that nlog4j aka log4j NG finds and uses it
      automatically, if one has not explictly configured it. And of course
      build/lib/log4j has been replaced with nlog4j (see
      http://www.slf4j.org/nlog4j/download.html)

      Regards,
      jens.

        Issue Links

          Activity

          Hide
          Henning Schmiedehausen added a comment -

          Close resolved issues for Release 1.5

          Show
          Henning Schmiedehausen added a comment - Close resolved issues for Release 1.5
          Hide
          Ceki Gulcu added a comment -

          Henning, I am not aware of any mud slinging between the various projects you've mentioned. Is there any specific reference you could point at?

          Show
          Ceki Gulcu added a comment - Henning, I am not aware of any mud slinging between the various projects you've mentioned. Is there any specific reference you could point at?
          Hide
          Will Glass-Husain added a comment -

          Makes sense.

          Obviously, you could always create a LogChute that acts as a bridge between Velocity and slf4j.

          Show
          Will Glass-Husain added a comment - Makes sense. Obviously, you could always create a LogChute that acts as a bridge between Velocity and slf4j.
          Hide
          Henning Schmiedehausen added a comment -

          Nope. -1 here. If we move to another logging system it's either JCL (Jakarta commons logging) or log4j directly.

          There is so much mud slinging around the log4j, nlog4j, slf4j and logback projects (not to talk about the licensing issues with logback to which slf4j is dangerously near) that I don't want to go near there.

          Nathan did a major rework for velocity logging for 1.5 and currently, while the logging is still a bit too heavy for my liking (I'd like to switch to JCL), there is no way that we move to a politically encumbered project that is run outside the ASF for something as mission critical as logging.

          Show
          Henning Schmiedehausen added a comment - Nope. -1 here. If we move to another logging system it's either JCL (Jakarta commons logging) or log4j directly. There is so much mud slinging around the log4j, nlog4j, slf4j and logback projects (not to talk about the licensing issues with logback to which slf4j is dangerously near) that I don't want to go near there. Nathan did a major rework for velocity logging for 1.5 and currently, while the logging is still a bit too heavy for my liking (I'd like to switch to JCL), there is no way that we move to a politically encumbered project that is run outside the ASF for something as mission critical as logging.
          Hide
          Will Glass-Husain added a comment -

          thanks for contributing this.

          Would you be interested in putting this on the Wiki for greater visibility?
          http://wiki.apache.org/jakarta-velocity/ContributedCode

          Show
          Will Glass-Husain added a comment - thanks for contributing this. Would you be interested in putting this on the Wiki for greater visibility? http://wiki.apache.org/jakarta-velocity/ContributedCode
          Hide
          Jens Elkner added a comment -

          Created an attachment (id=15638)
          slf4j logsystem patch + some minor code cleanup

          Show
          Jens Elkner added a comment - Created an attachment (id=15638) slf4j logsystem patch + some minor code cleanup

            People

            • Assignee:
              Henning Schmiedehausen
              Reporter:
              Jens Elkner
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development