Reputation: 21
We would like to use Log4J's "AsynchAppender"
within our Java EE application. The application is deployed on a Glassfish V2 app-server
.
Log4J's "AsynchAppender" is based on a thread implementation. Threads in turn should be avoided within Java EE applications. Are there any experiences using the "AsynchAppender"? What are best practices doing asynchronous logging using Log4J in Java EE applications?
Upvotes: 2
Views: 473
Reputation: 1339
You can use log4j AsyncAppender to log asynchronous way in your J2EE applications.
AsyncAppender collects the events sent to it and then dispatch them to all the real appenders that are referred.It uses a separate thread to serve the events in its buffer.Implementing thread calls in request handler is generally discouraged in J2EE applications. Best practice is to dedicate logging as separate service which will handles all logs of that application.
Upvotes: 2