db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karan malhi <karan.ma...@gmail.com>
Subject Re: generated sql
Date Mon, 05 Sep 2005 15:51:58 GMT
Thanks,

I did try to change log4j.logger.JPOX.RDBMS=debug. Somehow it didnt work 
for me. Let me try that configuration again.

Michael Watzek wrote:

> Hi Karan,
>
> thanks for supplying this patch.
>
> We are currently providing some logging documentation which we will 
> put onto the wiki. Below, you find some comments on TCK logging in 
> general.
>
> A TCK run involves several tools/components. Each of these components 
> use the same or different logging implementations:
>
> - Derby uses propriatary logging.
> - JPOX uses Log4J.
> - TCK/SpringFramwork uses Apache commons-logging.
> - TCK/JUnit uses propriatary logging.
>
> Each of the involved logging implementations use different properties 
> files configuring logging. All of these files are located in "test/conf":
>
> - Derby uses "derby.properties".
> - Log4J uses log4j.properties
> - Apache commons-logging uses "common-logging.properties".
>
> The current logging configurations specify that log messages of all 
> components are written to files which are placed in subdirectories of 
> ".../target/logs". There, you have separate subdirectories for Derby 
> and the JPOX enhancer. The TCK as well as the JPOX runtime logging 
> output is placed in a special timestamp subdirectory. There, you find 
> several log files, two for each configuration. One file contains the 
> TCK log, the other contains the JPOX log. The naming patterns are
>
> - <database><identity type><configuration>.txt
> - <database><identity type><configuration>-jpox.txt
>
> In your case, you like to have SQL statements in the JPOX logging 
> file. All you have to do is uncomment the following line in 
> "log4j.properties" (and replace the INFO log level by DEBUG):
>
> log4j.logger.JPOX.RDBMS=DEBUG, JPOX
>
> In particular, you do not need to change commons-logging.properties.
>
> Regards,
> Michael
>
>> Hi Craig,
>>
>> Here is the patch for enabling log4j and also to see the sql 
>> generated by JPOX. I guess some string filters can be set on it to 
>> get rid of some of the messages (like execution time messages)
>>
>> Index: commons-logging.properties
>>
>> ===================================================================
>>
>> --- commons-logging.properties    (revision 278625)
>>
>> +++ commons-logging.properties    (working copy)
>>
>> @@ -28,7 +28,8 @@
>>
>> #
>>
>> # Uncomment the next line if you want to use the apache simple logger
>> -org.apache.commons.logging.Log = 
>> org.apache.commons.logging.impl.SimpleLog
>> +#org.apache.commons.logging.Log = 
>> org.apache.commons.logging.impl.SimpleLog
>>
>> # Uncomment the next two lines if you want to use JDK 1.4 logging
>> #org.apache.commons.logging.Log = org.apache.jdo.tck.util.JDOJdk14Logger
>> +org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger 
>>
>> Index: log4j.properties
>>
>> ===================================================================
>>
>> --- log4j.properties    (revision 278625)
>>
>> +++ log4j.properties    (working copy)
>>
>> @@ -18,23 +18,28 @@
>>
>> ###########################
>>
>> # JPOX appenders
>> -log4j.appender.JPOX=org.apache.jdo.tck.util.TCKFileAppender
>> -log4j.appender.JPOX.File=jpox.txt
>> +#log4j.appender.JPOX=org.apache.jdo.tck.util.TCKFileAppender
>> +#log4j.appender.JPOX.File=jpox.txt
>> +log4j.appender.JPOX=org.apache.log4j.ConsoleAppender
>> log4j.appender.JPOX.layout=org.apache.log4j.PatternLayout
>> log4j.appender.JPOX.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) 
>> %-5p [%c] - %m%n
>>
>> # JPOX loggers
>> -log4j.logger.JPOX=INFO, JPOX
>> +log4j.logger.JPOX=ERROR, JPOX
>> +log4j.logger.JPOX.RDBMS.SQL=DEBUG, JPOX
>> +log4j.logger.org.springframework.beans.factory.xml.XmlBeanDefinitionReader=INFO,

>> JPOX
>> +log4j.additivity.JPOX=false
>> +log4j.additivity.JPOX.RDBMS.SQL=false
>> +#log4j.addivity.org.springframework.beans.factory.xml.XmlBeanDefinitionReader=false

>>
>> #log4j.logger.JPOX.JDO=INFO, JPOX
>> #log4j.logger.JPOX.Cache=INFO, JPOX
>> #log4j.logger.JPOX.MetaData=INFO, JPOX
>> #log4j.logger.JPOX.General=DEBUG, JPOX
>> #log4j.logger.JPOX.Utility=INFO, JPOX
>> #log4j.logger.JPOX.Transaction=INFO, JPOX
>> -#log4j.logger.JPOX.RDBMS=INFO, JPOX
>> +#log4j.appender.JPOX.RDBMS=org.apache.log4j.ConsoleAppender
>> +#log4j.logger.JPOX.Enhancer=INFO, JPOX
>> +#log4j.logger.JPOX.SchemaTool=INFO, JPOX
>>
>> -log4j.logger.JPOX.Enhancer=INFO, JPOX
>> -log4j.logger.JPOX.SchemaTool=INFO, JPOX
>> -
>> # C3P0 loggers
>> log4j.logger.com.mchange.v2=INFO, JPOX
>>
>>
>> Craig Russell wrote:
>>
>>> Hi Karan,
>>>
>>> The log4j property file is found at tck20/test/conf/log4j.properties.
>>>
>>> Let us know once you get the right properties, and we can update the 
>>> "how to run the tck" page.
>>>
>>> Craig
>>>
>>> On Sep 4, 2005, at 6:09 PM, karan malhi wrote:
>>>
>>>> These properties can be found on the following url : 
>>>> http://www.jpox.org/docs/1_1/logging.html
>>>> According to the jpox website, we have to set these properties in 
>>>> the log4j.properties file. There is one property which i found 
>>>> "JPOX.RDBMS.SQL" , which would display the generated sql. But, i 
>>>> dont know how to integrate this with the SimpleLog we are using in 
>>>> maven.
>>>>
>>>>
>>>> Craig Russell wrote:
>>>>
>>>>
>>>>> Hi Karan,
>>>>>
>>>>> The recent changes to the logging result in the jpox log being 
>>>>> created in the same directory as the test output files. You can 
>>>>> configure the logging by using jpox-specific properties in the 
>>>>> tck20/test/conf/jdori.properties configuration file.
>>>>>
>>>>> I don't know the exact property to use, though.
>>>>>
>>>>> Can JPOX experts share these properties? And perhaps update the 
>>>>> jdori.properties with the values and a clue as to how to do this?
>>>>>
>>>>> Craig
>>>>>
>>>>> On Sep 4, 2005, at 3:40 PM, karan malhi wrote:
>>>>>
>>>>>
>>>>>> Can i somehow view (in the log) the sql which jpox generates?
>>>>>>
>>>>>> -- 
>>>>>> Karan Singh
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> Craig Russell
>>>>>
>>>>> Architect, Sun Java Enterprise System 
>>>>> http://java.sun.com/products/jdo
>>>>>
>>>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>>>
>>>>> P.S. A good JDO? O, Gasp!
>>>>>
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> Karan Singh
>>>>
>>>>
>>>
>>> Craig Russell
>>>
>>> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
>>>
>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>
>>> P.S. A good JDO? O, Gasp!
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> Index: commons-logging.properties
>> ===================================================================
>> --- commons-logging.properties    (revision 278625)
>> +++ commons-logging.properties    (working copy)
>> @@ -28,7 +28,8 @@
>>  #
>>  
>>  # Uncomment the next line if you want to use the apache simple logger
>> -org.apache.commons.logging.Log = 
>> org.apache.commons.logging.impl.SimpleLog
>> +#org.apache.commons.logging.Log = 
>> org.apache.commons.logging.impl.SimpleLog
>>  
>>  # Uncomment the next two lines if you want to use JDK 1.4 logging
>>  #org.apache.commons.logging.Log = 
>> org.apache.jdo.tck.util.JDOJdk14Logger
>> +org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger 
>>
>> Index: log4j.properties
>> ===================================================================
>> --- log4j.properties    (revision 278625)
>> +++ log4j.properties    (working copy)
>> @@ -18,23 +18,28 @@
>>  ###########################
>>  
>>  # JPOX appenders
>> -log4j.appender.JPOX=org.apache.jdo.tck.util.TCKFileAppender
>> -log4j.appender.JPOX.File=jpox.txt
>> +#log4j.appender.JPOX=org.apache.jdo.tck.util.TCKFileAppender
>> +#log4j.appender.JPOX.File=jpox.txt
>> +log4j.appender.JPOX=org.apache.log4j.ConsoleAppender
>>  log4j.appender.JPOX.layout=org.apache.log4j.PatternLayout
>>  log4j.appender.JPOX.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) 
>> %-5p [%c] - %m%n
>>  
>>  # JPOX loggers
>> -log4j.logger.JPOX=INFO, JPOX
>> +log4j.logger.JPOX=ERROR, JPOX
>> +log4j.logger.JPOX.RDBMS.SQL=DEBUG, JPOX
>> +log4j.logger.org.springframework.beans.factory.xml.XmlBeanDefinitionReader=INFO,

>> JPOX
>> +log4j.additivity.JPOX=false
>> +log4j.additivity.JPOX.RDBMS.SQL=false
>> +#log4j.addivity.org.springframework.beans.factory.xml.XmlBeanDefinitionReader=false

>>
>>  #log4j.logger.JPOX.JDO=INFO, JPOX
>>  #log4j.logger.JPOX.Cache=INFO, JPOX
>>  #log4j.logger.JPOX.MetaData=INFO, JPOX
>>  #log4j.logger.JPOX.General=DEBUG, JPOX
>>  #log4j.logger.JPOX.Utility=INFO, JPOX
>>  #log4j.logger.JPOX.Transaction=INFO, JPOX
>> -#log4j.logger.JPOX.RDBMS=INFO, JPOX
>> +#log4j.appender.JPOX.RDBMS=org.apache.log4j.ConsoleAppender
>> +#log4j.logger.JPOX.Enhancer=INFO, JPOX
>> +#log4j.logger.JPOX.SchemaTool=INFO, JPOX
>>  
>> -log4j.logger.JPOX.Enhancer=INFO, JPOX
>> -log4j.logger.JPOX.SchemaTool=INFO, JPOX
>> -
>>  # C3P0 loggers
>>  log4j.logger.com.mchange.v2=INFO, JPOX
>
>
>

-- 
Karan Singh


Mime
View raw message