Serialized Form

  • Package cn.unikue.springstarter.p6spy.property

    • Class cn.unikue.springstarter.p6spy.property.P6spyProperties

      class P6spyProperties extends Object implements Serializable
      • Serialized Fields

        • append
          Boolean append
          Append to the p6spy log file

          if this is set to false the log file is truncated every time (file logger only)

          Default is true

        • appender
          Class<? extends com.p6spy.engine.spy.appender.P6Logger> appender
          Specifies the appender to use for logging

          Only the properties read from the configuration file

          Note: reload means forgetting all the previously settings (even those set during runtime - via JMX) and starting with the clean table

          The original default is com.p6spy.engine.spy.appender.FileLogger

          
           appender = com.p6spy.engine.spy.appender.NoopLogger
           appender = com.p6spy.engine.spy.appender.Slf4JLogger
           appender = com.p6spy.engine.spy.appender.StdoutLogger
           appender = com.p6spy.engine.spy.appender.FileLogger
           
        • autoFlush
          Boolean autoFlush
          For flushing per statement
        • customLogMessageFormat
          String customLogMessageFormat
          Custom log message format used ONLY if logMessageFormat is set to com.p6spy.engine.spy.appender.CustomLineFormat

          Default is %(currentTime)|%(executionTime)|%(category)|connection%(connectionId)|%(sqlSingleLine)

          Available placeholders are:

          
           %(connectionId)            the id of the connection
           %(currentTime)             the current time expressing in milliseconds
           %(executionTime)           the time in milliseconds that the operation took to complete
           %(category)                the category of the operation
           %(effectiveSql)            the SQL statement as submitted to the driver
           %(effectiveSqlSingleLine)  the SQL statement as submitted to the driver, with all new lines removed
           %(sql)                     the SQL statement with all bind variables replaced with actual values
           %(sqlSingleLine)           the SQL statement with all bind variables replaced with actual values, with all new lines removed
           
        • databaseDialectBooleanFormat
          String databaseDialectBooleanFormat
          Format that is used for logging booleans, possible values: boolean, numeric

          Default is "boolean"

        • databaseDialectDateFormat
          String databaseDialectDateFormat
          Format that is used for logging of the Date implementations

          Has to be compatible with SimpleDateFormat

          Default is "yyyy-MM-dd HH:mm:ss"

        • databaseDialectTimestampFormat
          String databaseDialectTimestampFormat
          Format that is used for logging of the Timestamp implementations

          Has to be compatible with SimpleDateFormat

          Default is "yyyy-MM-dd HH:mm:ss.SSS"

        • dateFormat
          String dateFormat
          Sets the date format using SimpleDateFormat

          Default is "yyyy-MM-dd HH:mm:ss"

        • driverList
          String driverList
          A comma separated list of JDBC drivers to load and register

          Note: This is normally only needed when using P6Spy in an application server environment with a JNDI data source or when using a JDBC driver that does not implement the JDBC 4.0 API (specifically automatic registration).

        • enabled
          Boolean enabled
          Indicates whether to enable this starter or not

          Default is true

        • jmx
          Boolean jmx
          Whether to expose options via JMX or not

          Default is true

        • jmxPrefix
          String jmxPrefix
          If exposing options via jmx (see jmx), what should be the prefix used?

          jmx naming pattern constructed is: com.p6spy(.)?:name=

          Note, if there is already such a name in use it would be unregistered first (the last registered wins)

        • jndiContextCustom
          String jndiContextCustom
          JNDI DataSource lookup

          If you are using the DataSource support outside an app server, you will probably need to define the JNDI Context environment.

          If the P6Spy code will be executing inside an app server then do not use these properties, and the DataSource lookup will use the naming context defined by the app server.

          The two standard elements of the naming environment are jndiContextFactory and jndiContextProviderUrl. If you need additional elements, use the jndiContextCustom property.

          You can define multiple properties in jndiContextCustom in name value pairs. Separate the name and value with a semicolon, and separate the pairs with commas.

          The example shown here is for a standalone program running on a machine that is also running JBoss, so the JNDI context is configured for JBoss (3.0.4)

          
           jndiContextFactory = org.jnp.interfaces.NamingContextFactory
           jndiContextProviderUrl = localhost:1099
           jndiContextCustom = java.naming.factory.url.pkgs;org.jboss.naming:org.jnp.interfaces
           
        • jndiContextFactory
          String jndiContextFactory
          JNDI DataSource lookup

          If you are using the DataSource support outside an app server, you will probably need to define the JNDI Context environment.

          If the P6Spy code will be executing inside an app server then do not use these properties, and the DataSource lookup will use the naming context defined by the app server.

          The two standard elements of the naming environment are jndiContextFactory and jndiContextProviderUrl. If you need additional elements, use the jndiContextCustom property.

          You can define multiple properties in jndiContextCustom in name value pairs. Separate the name and value with a semicolon, and separate the pairs with commas.

          The example shown here is for a standalone program running on a machine that is also running JBoss, so the JNDI context is configured for JBoss (3.0.4)

          
           jndiContextFactory = org.jnp.interfaces.NamingContextFactory
           jndiContextProviderUrl = localhost:1099
           jndiContextCustom = java.naming.factory.url.pkgs;org.jboss.naming:org.jnp.interfaces
           
        • jndiContextProviderUrl
          String jndiContextProviderUrl
          JNDI DataSource lookup

          If you are using the DataSource support outside an app server, you will probably need to define the JNDI Context environment.

          If the P6Spy code will be executing inside an app server then do not use these properties, and the DataSource lookup will use the naming context defined by the app server.

          The two standard elements of the naming environment are jndiContextFactory and jndiContextProviderUrl. If you need additional elements, use the jndiContextCustom property.

          You can define multiple properties in jndiContextCustom in name value pairs. Separate the name and value with a semicolon, and separate the pairs with commas.

          The example shown here is for a standalone program running on a machine that is also running JBoss, so the JNDI context is configured for JBoss (3.0.4)

          
           jndiContextFactory = org.jnp.interfaces.NamingContextFactory
           jndiContextProviderUrl = localhost:1099
           jndiContextCustom = java.naming.factory.url.pkgs;org.jboss.naming:org.jnp.interfaces
           
        • logFile
          String logFile
          Name of logfile to use

          Used for com.p6spy.engine.spy.appender.FileLogger only

          Default is "p6spy.log"

          Note: Windows users should make sure to use forward slashes (/) in their pathname

        • logMessageFormat
          Class<? extends com.p6spy.engine.spy.appender.MessageFormattingStrategy> logMessageFormat
          Class to use for formatting log messages

          The original default is com.p6spy.engine.spy.appender.SingleLineFormat

        • moduleList
          String moduleList
          Module list adapts the modular functionality of P6Spy

          Only modules listed are active

          Default is com.p6spy.engine.logging.P6LogFactory and com.p6spy.engine.spy.P6SpyFactory

          Note: the core module (P6SpyFactory) can't be deactivated
          Unlike the other properties, activation of the changes on this one requires reload

        • realDatasource
          String realDatasource
          DataSource replacement

          Replace the real DataSource class in your application server configuration with the name com.p6spy.engine.spy.P6DataSource (that provides also connection pooling and xa support). then add the JNDI name and class name of the real DataSource here

          Values set in this item cannot be reloaded using the reloadProperties variable. Once it is loaded, it remains in memory until the application is restarted

          The example shown here is for mysql

          
           realDatasource = /RealMySqlDS
           
        • realDatasourceClass
          Class<? extends DataSource> realDatasourceClass
          DataSource class replacement

          The example shown here is for mysql

          
           realDatasourceClass = com.mysql.jdbc.jdbc2.optional.MysqlDataSource
           
        • realDatasourceProperties
          String realDatasourceProperties
          DataSource properties

          If you are using the DataSource support to intercept calls to a DataSource that requires properties for proper setup, define those properties here. Use name value pairs, separate the name and value with a semicolon, and separate the pairs with commas.

          The example shown here is for mysql

          
           realDatasourceProperties = port;3306,serverName;host,databaseName;jbossdb,foo;bar
           
        • reloadProperties
          Boolean reloadProperties
          Determines if property file should be reloaded

          Note: reload means forgetting all the previously settings (even those set during runtime - via JMX) and starting with the clean table

        • reloadPropertiesInterval
          Integer reloadPropertiesInterval
          Determines how often should be reloaded in seconds

          Default is 60

        • stackTrace
          Boolean stackTrace
          Prints a stack trace for every statement logged
        • stackTraceClass
          Class<?> stackTraceClass
          If stacktrace is true, specifies the stack trace to print