Description
In order to avoid deadlocks, when we have the option we should try to avoid enqueueing events for async loggers from threads that extend Log4jThread. Submitting events between AsyncLoggerContexts is rare, but can allow multiple disruptors to deadlock feeding events from one to the other. Similarly using both mixed async loggers with AsyncLoggerContext results in events flowing from one disruptor to another.
There are several areas we can avoid these potential lockups by checking if the current thread is a Log4jThread and logging synchronously. Note that in these cases, events may be serialized to disk in an unexpected order, however the scenario is both sufficiently rare and dangerous that I think it's worthwhile to change.