1

I would like to employ Log4j2 Asynchronous loggers within an Java EE 7 Applicatiosn.

This entails using the LMAX disruptor-3.0.0.jar or higher on the classpath.

I am concerned this breaks the rule related to starting "user" threads within a Java EE container.

Does the log4j2 automatic configuartion detect the presence of a Jee container? or do I need to pass log4j2 ManagedExecutorService? to use in WorkerPool?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Hector
  • 4,016
  • 21
  • 112
  • 211

1 Answers1

1

You might be right that using Async Loggers (or AsyncAppender, for that matter) breaks the J2EE rules. At the moment Log4j 2 creates its own ExecutorService (with a call to Executors.newSingleThreadExecutor).

I recommend that you create a feature request ticket on the Log4j 2 Jira to propose adding the ability for user code (or configuration) to specify a ManagedExecutorService for use by the Disruptor.

Remko Popma
  • 35,130
  • 11
  • 92
  • 114