Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-101

Create a bridge between System.out/System.err and SLF4J

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • None
    • None
    • Unspecified
    • None
    • Operating System: All
      Platform: All

    Description

      On my last project I was irritated by legacy and poorly written code writing to System.out and System.err, including some third party libraries that I could not alter. So I thought I'd write a bridge between System.out and System.err and SLF4J so that I would be able to turn them on and off. Here it is.

      I've tried to handle the problem of recursion and allowing logging packages to still write to the Console. I've also supplied a ServletContextListener to make it simple to set up in a web application.

      There is probably more that can be done around preventing recursion disasters - possibly throwing an Error? I would also like to explore using the marker I have attached to stack trace events to suppress the pattern other than the message itself.

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            robert@teviotia.co.uk Robert Elliot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: