You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "makkimesser (via GitHub)" <gi...@apache.org> on 2023/10/26 21:17:44 UTC
Re: [I] Logger class is not serializable (logging-log4j2)
makkimesser commented on issue #1884:
URL: https://github.com/apache/logging-log4j2/issues/1884#issuecomment-1781908104
> @makkimesser, could you share some details about your use case, please? Why do you serialize `Logger`s?
I stumbled over the issue while running our test-suite, when testing V2.21.0 and I got the mentioned NotSerializableException. There are some tests with classes containing loggers, if the logger-field is static or transient, there is no problem, but if the logger-field is non-static and non-transient the serialization method failed in V2.21.0 while it did not fail with V2.20.0.
We have such non-static and non-transient logger-fields in abstract parent classes to avoid to declare the logger in each of the child-classes. I'm not sure about the real reason of this behaviour, the code base is created before I joined my current job.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org