1

In Weblogic, using log4jdbc, I need to log queries (using org.jdbcdslog.StatementLogger) only in a specific file but not in console.

I tried to start Weblogic with this parameter

-Dlog4j.configuration=file:%LOG4JDBC_HOME%\log4j.xml

This is the content of log4.xml file

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt; <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender"> <param name="Threshold" value="DEBUG" /> <param name="File" value="./logs/aladin.log" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %-30.30c %m%n" /> </layout> </appender> <category name="org.jdbcdslog.StatementLogger"> <priority value="INFO" /> <appender-ref ref="fileAppender" /> </category> <category name="org.jdbcdslog.ResultSetLogger"> <priority value="FATAL" /> <appender-ref ref="fileAppender" /> </category> <root> <level value="DEBUG" /> <appender-ref ref="fileAppender" /> </root>

&lt;/log4j:configuration&gt;

The problem is that in console I see either org.jdbcdslog.StatementLogger and org.jdbcdslog.ResultSetLogger logged at INFO level, in aladin.log (the only file I'd like to log in) I don't see any log of org.jdbcdslog.StatementLogger and org.jdbcdslog.ResultSetLogger classes.

Is there a way to log these two classes only in aladin.log and not in console?

Francesca
  • 11
  • 1
  • There is an option in under server tab, under logging , there will be an option to turn on System.out and system.error logs . Please see if this helps – Sam Mar 18 '16 at 04:27
  • My problem is that no write sql query into the file defined in log4j.xml. On System.out and error logs either org.jdbcdslog.StatementLogger and org.jdbcdslog.ResultSetLogger.
    Thanks
    – Francesca Mar 18 '16 at 10:23

0 Answers0