Announcement Announcement Module
Collapse
No announcement yet.
log sql w/ log4j Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • log sql w/ log4j

    I'm evaluating the spring framework. Currently I'm trying to get some JDBC Template code to log the SQL. I put this file in the classpath:

    log4j.properties

    log4j.appender.stdout=org.apache.log4j.ConsoleAppe nder
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.Patt ernLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{ ABSOLUTE} %5p %c{1}:%L - %m%n
    log4j.rootLogger=debug, stdout
    log4j.category.org.springframework.jdbc.core=DEBUG

    but I'm not seeing any sql.

    thoughts?

  • #2
    my output

    here is my entire output when I run, btw:

    /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -Dfile.encoding=MacRoman -classpath /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/deploy.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/javaws.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/management-agent.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/plugin.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/sa-jdi.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/alt-rt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/charsets.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/jconsole.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/management-agent.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/../Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext/sunpkcs11.jar:/Users/pswenson/dev/sag/research/spring ent recipes/code/dataaccess/target/classes:/Users/pswenson/dev/sag/research/spring ent recipes/code/dataaccess/config:/Users/pswenson/.m2/repository/commons-dbcp/commons-dbcp/1.2.1/commons-dbcp-1.2.1.jar:/Users/pswenson/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar:/Users/pswenson/.m2/repository/commons-pool/commons-pool/1.2/commons-pool-1.2.jar:/Users/pswenson/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/pswenson/.m2/repository/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar:/Users/pswenson/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2.jar:/Users/pswenson/.m2/repository/commons-io/commons-io/1.1/commons-io-1.1.jar:/Users/pswenson/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar:/Users/pswenson/.m2/repository/org/hibernate/hibernate-entitymanager/3.4.0.GA/hibernate-entitymanager-3.4.0.GA.jar:/Users/pswenson/.m2/repository/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar:/Users/pswenson/.m2/repository/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar:/Users/pswenson/.m2/repository/org/slf4j/slf4j-api/1.5.3/slf4j-api-1.5.3.jar:/Users/pswenson/.m2/repository/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar:/Users/pswenson/.m2/repository/org/hibernate/hibernate-core/3.3.0.SP1/hibernate-core-3.3.0.SP1.jar:/Users/pswenson/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar:/Users/pswenson/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/pswenson/.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar:/Users/pswenson/.m2/repository/org/testng/testng/5.7/testng-5.7-jdk15.jar:/Users/pswenson/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/Users/pswenson/.m2/repository/net/sf/ehcache/ehcache/1.5.0/ehcache-1.5.0.jar:/Users/pswenson/.m2/repository/backport-util-concurrent/backport-util-concurrent/1.1_01/backport-util-concurrent-1.1_01.jar:/Users/pswenson/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar:/Users/pswenson/.m2/repository/net/sf/jsr107cache/jsr107cache/1.0/jsr107cache-1.0.jar:/Users/pswenson/.m2/repository/org/slf4j/slf4j-jdk14/1.5.3/slf4j-jdk14-1.5.3.jar:/Users/pswenson/.m2/repository/com/atomikos/transactions-jta/3.2.3/transactions-jta-3.2.3.jar:/Users/pswenson/.m2/repository/com/atomikos/transactions-api/3.2.3/transactions-api-3.2.3.jar:/Users/pswenson/.m2/repository/com/atomikos/transactions/3.2.3/transactions-3.2.3.jar:/Users/pswenson/.m2/repository/com/atomikos/atomikos-util/3.2.3/atomikos-util-3.2.3.jar:/Users/pswenson/.m2/repository/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar:/Users/pswenson/.m2/repository/org/apache/activemq/activemq-all/5.2.0/activemq-all-5.2.0.jar:/Users/pswenson/.m2/repository/mysql/mysql-connector-java/5.1.1/mysql-connector-java-5.1.1.jar:/Users/pswenson/.m2/repository/postgresql/postgresql/8.3-603.jdbc3/postgresql-8.3-603.jdbc3.jar:/Users/pswenson/.m2/repository/org/springframework/spring-aspects/3.0.0.RC2/spring-aspects-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-beans/3.0.0.RC2/spring-beans-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-core/3.0.0.RC2/spring-core-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-asm/3.0.0.RC1/spring-asm-3.0.0.RC1.jar:/Users/pswenson/.m2/repository/org/springframework/spring-context/3.0.0.RC2/spring-context-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/pswenson/.m2/repository/org/springframework/spring-aop/3.0.0.RC2/spring-aop-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-expression/3.0.0.RC2/spring-expression-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-test/3.0.0.RC2/spring-test-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/apache/derby/derbyclient/10.4.2.0/derbyclient-10.4.2.0.jar:/Users/pswenson/.m2/repository/org/jboss/javaee/jboss-jca-api/1.5.0.CR2/jboss-jca-api-1.5.0.CR2.jar:/Users/pswenson/.m2/repository/org/jboss/jboss-common-core/2.2.5.GA/jboss-common-core-2.2.5.GA.jar:/Users/pswenson/.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar:/Users/pswenson/.m2/repository/org/springframework/spring-tx/3.0.0.RC2/spring-tx-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-jdbc/3.0.0.RC2/spring-jdbc-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-instrument/3.0.0.RC2/spring-instrument-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar:/Users/pswenson/.m2/repository/org/aspectj/aspectjweaver/1.6.2/aspectjweaver-1.6.2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-jms/3.0.0.RC2/spring-jms-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-oxm/3.0.0.RC2/spring-oxm-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-orm/3.0.0.RC2/spring-orm-3.0.0.RC2.jar:/Users/pswenson/.m2/repository/org/springframework/spring-context-support/3.0.0.RC2/spring-context-support-3.0.0.RC2.jar com.apress.springenterpriserecipes.vehicle.Main
    Nov 24, 2009 11:20:12 AM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@27ce2dd4: startup date [Tue Nov 24 11:20:12 MST 2009]; root of context hierarchy
    Nov 24, 2009 11:20:13 AM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [beans.xml]
    Nov 24, 2009 11:20:13 AM org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@3747c1db: defining beans [dataSource,vehicleDao,vehicleInsertOperation,vehic leQueryOperation,vehicleCountOperation]; root of factory hierarchy
    BLAH

    Comment

    Working...
    X