Log4j: different category priority than appender threshold?

I soon found the solution. Basically the use case is described in the jboss wiki here: docs.jboss.org/process-guide/en/html/log... Section 10.3.5 Redirecting Category Output This blog article was helpful as well: ptth://ourcraft.wordpress. Com/2008/10/23/customizing-log4j-logging-on-jboss/#comment-796.

I soon found the solution. Basically the use case is described in the jboss wiki here: docs.jboss.org/process-guide/en/html/log... Section 10.3.5 Redirecting Category Output. This blog article was helpful as well: ptth://ourcraft.wordpress.Com/2008/10/23/customizing-log4j-logging-on-jboss/#comment-796.

Ultimately here is what I used that worked: Note that you do not want to define the SQL_FILE appender in root; for some reason. That was the final piece.

This solution is not great for performance. In JBoss 4.2.1, by default, the root logger is set to DEBUG, and the appenders use thresholds to work around this. This means that any Java code checking Log.isDebugEnabled() will execute.

Try it in a debugger and see :-). My solution will avoid this problem. – Matt Solnit Feb 24 '10 at 16:52 In fact, I wouldn't be surprised if everything is writing DEBUG output to the SQL_FILE appender, not just iBatis.

– Matt Solnit Feb 24 '10 at 16:54.

An additional step needed for JBoss 4.2.1. GA is to remove any log4j jar files from the war. If this jar is included in your war, the sql.

Log file is never written to. Example maven pom. Xml entry: log4j log4j 1.2.13 provided.

To the best of my knowledge, the classes in the java. Sql package do not actually do any logging, and they definitely do not write to log4j (or even commons-logging). However, for theoretical purposes, here is how you would solve this problem if it were a different package (and commons-logging were actually being used): Remove the threshold from the SQL_FILE appender.

Add the line: to the element (before the appender-ref). Save and re-start JBoss. Finally, note that for certain JDBC issues, the DriverManager.

SetLogWriter method can be helpful (see java.sun.com/products/jdbc/reference/faq...). EDIT: Since you've indicated you're actually interested in logging iBatis output, you should just change to .

Thanks for the reply. See my solution below. It is ironic, but you are right that java.

Sql does not actually do any logging. But I guess through ibatis I am able to get the output. Here is a sample: 2010-02-22 16:48:45,469 DEBUG java.sql.

Connection com.ibatis.common.logging.jakarta. JakartaCommonsLoggingImpl {conn-100000} Connection 2010-02-22 16:48:45,479 DEBUG java.sql. Connection com.ibatis.common.logging.jakarta.

JakartaCommonsLoggingImpl {conn-100000} Preparing Statement: SELECT....... – james. Lorenzen Feb 22 '10 at 22:59 There is nothing ironic about it James. Java.

Sql is a core JAVA package. It should not use log4j or commons-logging. Java.util.logging.

Logger is a JDK class which can be used but that came in JDK 1.4. – Calm Storm Feb 23 '10 at 17:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions