Details
Description
We use log4j 2 for logging inside our J2EE app (packaged as EAR, log4j JARs are bundled inside). The app is deployed on JBOSS EAP 6.1 app server. We are using the JDBCAppender for logging to a PostgreSQL database, and the appender is configured to use a DataSource for fetching connections. The appender is configured as follows:
<JDBC name="jdbcAppender" tableName="log_entries">
<DataSource jndiName="java:jboss/datasources/XyzDS" />
<Column name="log_entries_message" isUnicode="false" pattern="%message" />
<Column name="log_entries_type" literal="0" />
.....
The problem is: after the EAR is stopped (undeployed) log4j is not releasing the JDBC connection back to the connection pool, and after we stop/start the application a couple of times, our server becomes useless because there are no more free connections in the connection pool. I've looked at the thread dump of the server and there are a lot of threads like this:
org.apache.logging.log4j.core.LoggerContext$ShutdownThread @ 0xbe447138
Attachments
Issue Links
- is related to
-
LOG4J2-442 Log4j2 Database insert problem in Websphere
- Resolved
-
LOG4J2-407 JDBCAppender cannot recover from loss of database connectivity
- Resolved
-
LOG4J2-438 JDBCDatabaseManager does not send commit command
- Resolved
-
LOG4J2-489 Should JPADatabaseManager being using so many transactions?
- Closed
- relates to
-
LOG4J2-442 Log4j2 Database insert problem in Websphere
- Resolved
-
LOG4J2-407 JDBCAppender cannot recover from loss of database connectivity
- Resolved
-
LOG4J2-438 JDBCDatabaseManager does not send commit command
- Resolved
-
LOG4J2-489 Should JPADatabaseManager being using so many transactions?
- Closed