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

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

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • None
    • Implementations
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: