I would like to persist the logs into database instead of file. I have done some of the changes based on my finding in jboss forum. but I couldn't achieve to write logs into database (oracle). The changes which I have done are,
Steps 1: Created the table into database (oracle) using below query
CREATE TABLE LOGS (
Step 2: Added the below lines into jboss-log4j.xml
<appender name="jdbcAppender" class="org.apache.log4j.jdbc.JDBCAppender">
<param name="URL" value="jdbc:oracle:thin:localhost:1521:xe" />
<param name="Driver" value="oracle.jdbc.driver.OracleDriver" />
<param name="User" value="esb" />
<param name="Password" value="esb1234" />
<param name="Sql" value="INSERT INTO LOGS VALUES('%d','%-5p','%c','%t','%m')" />
<priority value="INFO" />
From the step 2, I am trying to log in both file and db, I could able to see the logs only in file but not in db. Anybody can guide me to resolve this issue..
Thanks and Regards,
This isn't really an ESB question, but maybe the "Sql" element should be "sql", and the "User" and "Password" and "Driver" params should be "user", "password", and "driver" respectively? Maybe you haven't hit the buffer also and should force a whole bunch of logging information so that you make sure you hit the buffer for jdbc write?