Hi, unfortunately the logging scheme has changed a few times in the past, but you still find the old references in some documentation. The objectstyle stuff has gone since 3.0.
For 3.1 you need a line like this: log4j.logger.org.apache.cayenne.log.CommonsJdbcEventLogger = INFO This will print all the query details to your log. Wernke On 2012-02-15 14:26, ngong wrote: > Dear Apache professionals, > > I need some more advises to make logging work for me. I do not know neither > CommonsLogging, nor log4j . > > The link to "recommendations" in https://cwiki.apache.org/CAY/log4j-faq.html > does not work. > http://cayenne.apache.org/doc/configuring-logging.html seems to address > people with knowledge that I miss. > > I did a log4j.properties from some googleling. That seems to get read as I > can see from -Dlog4j.configDebug=true. > > But I did not get any SQL in the console output. Any help would be welcome. > Also advices how to debug "commit exception" if there are better ways than > inspection of logging output (once I got them). > > The output is: > > log4j: Trying to find [log4j.xml] using context classloader > sun.misc.Launcher$AppClassLoader@1f7182c1. > log4j: Trying to find [log4j.xml] using > sun.misc.Launcher$AppClassLoader@1f7182c1 class loader. > log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource(). > log4j: Trying to find [log4j.properties] using context classloader > sun.misc.Launcher$AppClassLoader@1f7182c1. > log4j: Using URL > [file:/home/rsc/workspace/tracking/target/classes/log4j.properties] for > automatic log4j configuration. > log4j: Reading configuration from URL > file:/home/rsc/workspace/tracking/target/classes/log4j.properties > log4j: Parsing for [root] with value=[WARN, A1]. > log4j: Level token is [WARN]. > log4j: Category root set to WARN > log4j: Parsing appender named "A1". > log4j: Parsing layout options for "A1". > log4j: Setting property [conversionPattern] to [%-5p %c{1}: %m%n]. > log4j: End of parsing for "A1". > log4j: Parsed "A1" options. > log4j: Parsing for [org.objectstyle.cayenne] with value=[WARN]. > log4j: Level token is [WARN]. > log4j: Category org.objectstyle.cayenne set to WARN > log4j: Handling log4j.additivity.org.objectstyle.cayenne=[null] > log4j: Parsing for [org.objectstyle.cayenne.access.QueryLogger] with > value=[INFO]. > log4j: Level token is [INFO]. > log4j: Category org.objectstyle.cayenne.access.QueryLogger set to INFO > log4j: Handling > log4j.additivity.org.objectstyle.cayenne.access.QueryLogger=[null] > log4j: Parsing for [org.apache.cayenne.access.QueryLogger] with > value=[INFO]. > log4j: Level token is [INFO]. > log4j: Category org.apache.cayenne.access.QueryLogger set to INFO > log4j: Handling > log4j.additivity.org.apache.cayenne.access.QueryLogger=[null] > log4j: Finished configuring. > 15.02.2012 14:16:55 eu.ngong.ehour.tracking.impl.Run run > SCHWERWIEGEND: unexpected exception: class > org.apache.cayenne.CayenneRuntimeException [v.3.1M3 Sep 12 2011 19:59:45] > Commit Exception > Exception in thread "main" eu.ngong.ehour.tracking.TrackingException: > unexpected exception: class org.apache.cayenne.CayenneRuntimeException > [v.3.1M3 Sep 12 2011 19:59:45] Commit Exception > at eu.ngong.ehour.tracking.impl.Run.run(Run.java:114) > at eu.ngong.ehour.tracking.Main.main(Main.java:15) > > > -- > View this message in context: > http://cayenne.195.n3.nabble.com/logging-first-steps-tp3746972p3746972.html > Sent from the Cayenne - User mailing list archive at Nabble.com. -- /Wernke zur Borg *Rhea System S.A.* Robert-Bosch-Str. 7 64293 Darmstadt / Germany Tel. +49-6151-8709591/ This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it or any purpose or disclose its content to any person, but delete this message and any attachments from your system. RHEA System S.A. (RHEA) disclaims any and all liability if this email transmission was virus corrupted, altered or falsified. If a Non Disclosure Agreement (NDA) exists between RHEA and the receiving organization, then all contents shall be considered proprietary and covered under the NDA.
