I am seeing the following exception:
Exception in thread "Thread-7" java.lang.IllegalArgumentException: Event is not a serialized LogEvent: Shutdown
(I cannot reproduce this on other platforms)
I think this is what is happening:
[AppThread] calls ((LifeCycle) LogManager.getContext()).stop();
[AppThread] sets AsyncAppender.shutdown field to true (line 240)
[AsyncThread] breaks out of while(!shutdown) loop (line 196)
[AppThread] adds String "Shutdown" to queue
[AsyncThread] processes remaining items in the queue, tries to deserialize String "Shutdown" -> Error
replace AsyncAppender line 229:
final Log4jLogEvent event = Log4jLogEvent.deserialize(queue.take());
Serializable s = queue.take();
// or break?
final Log4jLogEvent event = Log4jLogEvent.deserialize(s);
I don't think this is a major issue as the AsyncThread will exit its run() method (so JVM can exit), it just looks a bit sloppy.