How to use Spring DataSource bean as data source for Log4j 2 JDBC appender
I would like to log log4j2 messages into a relational database using the datasource defined on application context and initialized using spring using log4j 2.10. One possibility is to add a JDBC appender inside log4j2 xml configuration but, Log4j is initialized before Spring so, dataSource won’t be available at runtime so the only solution is….