Details

    • Type: New Feature New Feature
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.2, JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Embedding, HelpWanted
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The current JRuby uses System.err to print out errors.

      When embedded inside OSGi containers, or in production scenarios, using System.err is impractical.

      slf4j is a logging library widely used and recommended for its composition approach. It provides a mapping to the JDK logger, which is useful to keep the existing behavior.

        Activity

        Hide
        Antoine Toulme added a comment -

        The work has started with a very limited experiment here:

        https://github.com/atoulme/jruby/tree/slf4j

        So far:
        -changed ivy to download slf4j api and jdk1.4 integration
        -changed build.xml to depend on downloading both jars
        -changed the prepare task to download the jars as prerequisites.
        -added org.slf4j in one class, Ruby, used for propagating NameErrors and the like.
        -used the logger in a few places to show use.

        TODO:
        -work on packaging slf4j api and jdk integration with the distrib
        -inline the slf4j code in jruby-complete
        -add many more loggers and log more
        -add the configuration file in the distrib
        -document use and provide instructions for embedding.

        Show
        Antoine Toulme added a comment - The work has started with a very limited experiment here: https://github.com/atoulme/jruby/tree/slf4j So far: -changed ivy to download slf4j api and jdk1.4 integration -changed build.xml to depend on downloading both jars -changed the prepare task to download the jars as prerequisites. -added org.slf4j in one class, Ruby, used for propagating NameErrors and the like. -used the logger in a few places to show use. TODO: -work on packaging slf4j api and jdk integration with the distrib -inline the slf4j code in jruby-complete -add many more loggers and log more -add the configuration file in the distrib -document use and provide instructions for embedding.
        Hide
        Charles Oliver Nutter added a comment -

        Because of the potential drastic change in how JRuby logs information as a result of this bug, I don't see it landing earlier than 1.7. Marking as such.

        Show
        Charles Oliver Nutter added a comment - Because of the potential drastic change in how JRuby logs information as a result of this bug, I don't see it landing earlier than 1.7. Marking as such.
        Hide
        Antoine Toulme added a comment -

        That's fine. Also, any help is welcome. This is the perfect introductory bug to get to know jruby intimately!

        Show
        Antoine Toulme added a comment - That's fine. Also, any help is welcome. This is the perfect introductory bug to get to know jruby intimately!
        Hide
        Charles Oliver Nutter added a comment -

        I have merged the changes to master! I removed the use of ivy, since using it for only one of our dependencies felt rather peculiar. If we move to ivy, we should move everything possible to ivy at the same time.

        Anyone that likes can freely start using slf4j now to replace "println" logging in JRuby. Should we resolve this bug, since that task is somewhat open-ended?

        Show
        Charles Oliver Nutter added a comment - I have merged the changes to master! I removed the use of ivy, since using it for only one of our dependencies felt rather peculiar. If we move to ivy, we should move everything possible to ivy at the same time. Anyone that likes can freely start using slf4j now to replace "println" logging in JRuby. Should we resolve this bug, since that task is somewhat open-ended?
        Hide
        Antoine Toulme added a comment -

        Fine by me. It's unclear how much println logging there is in jruby, do you want to open a separate task for that ?

        Show
        Antoine Toulme added a comment - Fine by me. It's unclear how much println logging there is in jruby, do you want to open a separate task for that ?
        Hide
        Charles Oliver Nutter added a comment -

        Marking as resolved. slf4j is now incorporated into JRuby's build and can be used for logging. I will open a separate issue to get println logging cleaned up.

        Show
        Charles Oliver Nutter added a comment - Marking as resolved. slf4j is now incorporated into JRuby's build and can be used for logging. I will open a separate issue to get println logging cleaned up.
        Hide
        Charles Oliver Nutter added a comment -

        Antoine: I have added JRUBY-5921 for migrating println debugging to slf4j. Currently 257 references to "println".

        Show
        Charles Oliver Nutter added a comment - Antoine: I have added JRUBY-5921 for migrating println debugging to slf4j. Currently 257 references to "println".
        Hide
        Leif Warner added a comment -

        How does this relate to the logger.class=[class name] setting described on https://github.com/jruby/jruby/wiki/ConfiguringJRuby ?

        Show
        Leif Warner added a comment - How does this relate to the logger.class= [class name] setting described on https://github.com/jruby/jruby/wiki/ConfiguringJRuby ?

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Antoine Toulme
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: