[Administration-Logging]: 04 Tracking SQL Statements

This allows logging on the SQL statement that is being parsed through the Repertoire Server using JDBC connection.

Add in the following codes into the \RepertoireServer\config\log-config.xml (For Server Versions 7.x, 8.x onwards)* -

<!-- Additional category entry to track all JDBC calls to database -->
   <appender name="JDBC" class="org.apache.log4j.RollingFileAppender">
       <param name="File" value="../log/JDBC.log"/>
       <param name="Append" value="false"/>
       <param name="MaxBackupIndex" value="5"/>
       <param name="MaxFileSize" value="1000KB"/>
       <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%d,%-5p, %c{2} - %m%n"/>
       </layout>
   </appender>

Note: The above is added to the first instance of the appender method in log-config.xml.

<!-- Additional category entry to track all JDBC calls to database -->
<category name="com.elixirtech.data2.datasource.jdbc.JDBCProcessor">
     <priority value="debug" />
      <appender-ref ref="JDBC" />
   </category>

Note: The above is added to the first instance of the category method in log-config.xml.

Add in the following codes into the \RepertoireServer\config\log-config.xml (For Server Version 6.x)* -

   <appender name="JDBC" class="com.elixirtech.ers2.log.RollingFileTimeStampAppender">
       <param name="File" value="../log/JDBC.log"/>
       <param name="FileDatePattern" value="yyyy-MM-dd"/>
       <param name="Append" value="false"/>
       <param name="MaxBackupIndex" value="5"/>
       <param name="MaxFileSize" value="1000KB"/>
       <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%d,%-5p, %c{2} - %m%n"/>
       </layout>
   </appender>

Note: The above is added to the first instance of the appender method in log-config.xml.

<!-- Additional category entry to track all JDBC calls to database -->
   <category name="ER.Data2.JDBC.JDBCProcessor">
     <priority value="debug" />
      <appender-ref ref="JDBC" />
   </category>

Note: The above is added to the first instance of the category method in log-config.xml.