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/"> <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>
</log4j:configuration>
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?
Thanks – Francesca Mar 18 '16 at 10:23