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

JCL loggers are Serializable, jcl104-over-slf4j logger is not

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Implementations
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      SLF4JLocationAwareLog (in jcl104-over-slf4j) should implement Serializable.

      Reason:
      Some (third-party) implementations use non-static JCL loggers in serializable classes. This works (at least with Log4J) because JCLs Log4JLogger implements Serializable and has a transient reference to the actual Log4J Logger, which it creates lazily on demand.

      Of course only adding the Serializable marker interface to SLF4JLocationAwareLog is not enough. Also the non transient reference to the LocationAwareLogger (the Log4jLoggerAdapter in that case) must be serializable then. This leads to the problem that Log4jLoggerAdapter must not have a non transient reference to the actual Log4J Logger, but also create it lazily.

      Don't know how difficult it is to fix that.
      But as I said before, this issue can severily break third-party libs (NotSerializableException) when JCL is replaced by jcl104-over-slf4j.

      Regards,
      Manfred

        Attachments

        1. AppleJCL.java
          0.3 kB
          Ceki Gulcu
        2. AppleSLF4J.java
          0.3 kB
          Ceki Gulcu
        3. SerializationTest.java
          1 kB
          Ceki Gulcu

          Activity

            People

            • Assignee:
              slf4j-dev SLF4J developers list
              Reporter:
              manolito Manfred Geiler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: