-
- Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
apiAffects the public APIAffects the public APIbugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing code
Milestone
Description
Description
Since 2.21.0 serializing a Logger raises java.io.NotSerializableException.
Maybe this is caused by this commit (see my comment on commit): e86d28b
Configuration
Version: 2.21.0
Operating system: Windows-10
JDK: OpenJDK 1.8.0_382
Logs
Exception in thread "main" java.io.NotSerializableException: java.lang.ThreadLocal at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at test.TestSerializeLogger.main(TestSerializeLogger.java:14) Reproduction
package test; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @SuppressWarnings("javadoc") public class TestSerializeLogger { public static void main(final String... args) throws IOException { try (ObjectOutputStream objOut = new ObjectOutputStream(new ByteArrayOutputStream())) { Logger logger = LogManager.getLogger("Test"); objOut.writeObject(logger); } } } Metadata
Metadata
Assignees
Labels
apiAffects the public APIAffects the public APIbugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing code