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 fileif 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 loggingOnly 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.FileLoggerappender = 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 iflogMessageFormatis set to com.p6spy.engine.spy.appender.CustomLineFormatDefault 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, numericDefault is
"boolean" -
databaseDialectDateFormat
String databaseDialectDateFormat
Format that is used for logging of theDateimplementationsHas to be compatible with
SimpleDateFormatDefault is
"yyyy-MM-dd HH:mm:ss" -
databaseDialectTimestampFormat
String databaseDialectTimestampFormat
Format that is used for logging of theTimestampimplementationsHas to be compatible with
SimpleDateFormatDefault is
"yyyy-MM-dd HH:mm:ss.SSS" -
dateFormat
String dateFormat
Sets the date format usingSimpleDateFormatDefault is
"yyyy-MM-dd HH:mm:ss" -
driverList
String driverList
A comma separated list of JDBC drivers to load and registerNote: 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 notDefault is
true -
jmx
Boolean jmx
Whether to expose options via JMX or notDefault is
true -
jmxPrefix
String jmxPrefix
If exposing options via jmx (seejmx), 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 lookupIf 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
jndiContextFactoryandjndiContextProviderUrl. If you need additional elements, use thejndiContextCustomproperty.You can define multiple properties in
jndiContextCustomin 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 lookupIf 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
jndiContextFactoryandjndiContextProviderUrl. If you need additional elements, use thejndiContextCustomproperty.You can define multiple properties in
jndiContextCustomin 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 lookupIf 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
jndiContextFactoryandjndiContextProviderUrl. If you need additional elements, use thejndiContextCustomproperty.You can define multiple properties in
jndiContextCustomin 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 useUsed for
com.p6spy.engine.spy.appender.FileLoggeronlyDefault 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 messagesThe original default is
com.p6spy.engine.spy.appender.SingleLineFormat -
moduleList
String moduleList
Module list adapts the modular functionality of P6SpyOnly modules listed are active
Default is
com.p6spy.engine.logging.P6LogFactoryandcom.p6spy.engine.spy.P6SpyFactoryNote: 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 replacementReplace 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
reloadPropertiesvariable. Once it is loaded, it remains in memory until the application is restartedThe example shown here is for mysql
realDatasource = /RealMySqlDS -
realDatasourceClass
Class<? extends DataSource> realDatasourceClass
DataSource class replacementThe example shown here is for mysql
realDatasourceClass = com.mysql.jdbc.jdbc2.optional.MysqlDataSource -
realDatasourceProperties
String realDatasourceProperties
DataSource propertiesIf 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 reloadedNote: 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 secondsDefault is
60 -
stackTrace
Boolean stackTrace
Prints a stack trace for every statement logged -
stackTraceClass
Class<?> stackTraceClass
If stacktrace istrue, specifies the stack trace to print
-
-
-