spy.properties settings

Help
2008-10-29
2013-04-25
  • oceanbreeze
    oceanbreeze
    2008-10-29

    I have following questions related to log genarated by p6spy.

    1. How can I capture start time and end time of SQL in spy.log (logfile=c:\\spy.log)? Can I capture these two values by changing properties of spy.properties?

    2. What do I have to so that the result and resultSet related log does not get displayed in spy.log (logfile=c:\\spy.log)file? I only want to see the prepared statement and the preparedstatement with the value. I do not want to log the result returned by querying the database.

    Can I accomplish the above by changing settings in spy.properties?

    In other words, I want to see the following only in spy.log:

    select col1 from table1 where id=?
    select col1 from table1 where id=1

    I do not want to see the result returned from the above query.

    3. If I point the logfile attribute in spy.properties to the output file of log4j, will both log4j and p6spy write to the same (single) log file?

    In other words, if I add the following in spy.properties:
    logfile=c:\\mylog4j.log

    Will both p6spy and log4j write the the above mylog4j.log file?

    4. What are the place holder values in between the first few pipes in the log file that gets generated by p6spy?

    For example, in the output below, what attribute is being presented inside each of these pipes?

    1225296359390|-1||debug||

    5. What do I have to do, if I do not want the formatting with pipe (e.g.  1225296359390|-1||debug||) that p6spy generates? Instead, I would like the formatting similar to the one generated by log4j. What modifications in spy.properties do I need in oprder to accomplish this?

    6. What do I have to do to have p6spy generate the same formatting as that of my existing log4j formatting? Do I have to make same entries log4j specific entries in spy.properties?

    In spy.properties, I have commented out the folliwng at this time:

    #The following are for log4j logging only
    #log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
    #log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
    #log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n

    Do I have to uncomment the above entries in spy.properties and set them up similar to my log4j properties, in order for p6spy to generate log similar to my log4j?

    7. What do I need to do to capture duration of a sql while using log4j type logging? In other words, p6spy by default shows duration of SQL as a value of inside one of the pipes. But if I want to make p6spy log similar to my log4j file but still want to capture the duration of SQL, what do I need to do?

    8. What should be my setting for includecategories and excludecategoriesShould if I want to display every possible SQL?

    Following is my spy.properties file:

    realdriver=COM.ibm.db2.jdbc.app.DB2Driver
    deregisterdrivers=true
    executionthreshold=
    outagedetection=false
    outagedetectioninterval=
    filter=false
    include     =
    exclude     =
    sqlexpression =
    autoflush   = true
    dateformat=
    includecategories=info,debug,result,batch
    excludecategories=
    stringmatcher=
    stacktrace=false
    stacktraceclass=
    reloadproperties=true
    reloadpropertiesinterval=60
    useprefix=false
    appender=com.p6spy.engine.logging.appender.FileLogger
    logfile=c:\\spy.log
    append=true
    #The following are for log4j logging only
    #log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
    #log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
    #log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n

     
    • Nitko Vazhan
      Nitko Vazhan
      2009-01-12

      All of these questions are answered in the documention supplied with the software. Specifically, you'll want to have a look at the other.html file. It explains in detail the settings used in spy.properties file.

      The same file can also be found here: http://www.p6spy.com/documentation/other.htm

      In short, yes. You can capture only selects, you can use regexps, you can customize the log file format, you can even use Log4j instead of the internal logger so you could combine its log with your application log.

      It's all explained very well in the documentation. Read the fine manual :)

       
    • Pat
      Pat
      2009-03-13

      which is now being developed