-
1. Re: Custom JPA Logging Appender
jamezp May 1, 2014 8:21 PM (in response to rareddy)You wouldn't really be able to have a handler (appender) that could use JPA. Logging is generally one of the first things configured. This would be well before JPA is setup.
It should be rather easy though to create a java.util.logging.Handler or org.jboss.logmanager.ExtHandler that uses JDBC though. You'd just need to configure a JDBC connection then handle the insert in the publish or doPublish method.
Then you would just add this as a module to EAP 6 and configure a custom-handler in the logging subsystem.
--
James R. Perkins
-
2. Re: Custom JPA Logging Appender
rareddy May 1, 2014 10:54 PM (in response to jamezp)James,
Thank you. Yes, we have one we developed using straight JDBC, My choice of JPA was to get away from
* custom DDL/DML statements
* ability plug-in target databases ad-hoc, and start logging
* not worry about any minor SQL syntax differences
* connection/transaction management
Luckily in our usecase it used for "autdit" related messages, so I am expecting messages to only flow after system is completely started, so I would be able to lookup the bean locally in the container and issue the JPA call. Logging to database itself is so heavy weight, I am concerned that, I may be over thinking in adding additional complexity with all the layers. Eventually the idea is to plug-in sources like Hive or time series databases to capture this log data for effective querying.
Ramesh..