I would like to configure log4j2 to store log information in a database table.
I know it works using java,sql,Connection, but I’d like to map the table exactly as I map the other table in order to take advantages of Hibernate first and second level cache.
This is the working code BUT the connection is just a “trick”
<JDBC name="PostgreSQLDatabase" tableName="plugin_luminare3.app_logs">
<ConnectionFactory
class="luminare.MainTest" method="getPGConnection" />
<Column name="LOG_ID" pattern="%u" />
<Column name="ENTRY_DATE" isEventTimestamp="true" />
<Column name="LOG_LEVEL" pattern="%level" />
<Column name="MESSAGE" pattern="%m" />
</JDBC>
Thanks in advance