Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
Log SQL statements
Administrators can optionally log all SQL statements used in sql macros. This option is enabled by adding configuration in the ../WEB-INF/classes/log4j.properties file. In addition, warnings are issued when the default row limit is exceeded.
No Format | ||
---|---|---|
| ||
# SQL statement logging
log4j.appender.sqlplugin=org.apache.log4j.RollingFileAppender
log4j.appender.sqlplugin.File=${catalina.home}/home/logs/sql-plugin.log
log4j.appender.sqlplugin.Threshold=INFO
log4j.appender.sqlplugin.MaxFileSize=20480KB
log4j.appender.sqlplugin.MaxBackupIndex=10
log4j.appender.sqlplugin.layout=com.atlassian.confluence.util.PatternLayoutWithContext
log4j.appender.sqlplugin.layout.ConversionPattern=%d %p %m%n
log4j.logger.org.swift.confluence.sql.SqlMacro.statement=INFO, sqlplugin
log4j.additivity.org.swift.confluence.sql.SqlMacro.statement=false
log4j.logger.org.swift.confluence.sql.SqlQueryMacro.statement=INFO, sqlplugin
log4j.additivity.org.swift.confluence.sql.SqlQueryMacro.statement=false
|
Add logging at runtime
- Go to Administration -> Logging and Profiling
- Find the Add new entry area
- Add INFO entries for the following: org.swift.confluence.sql.SqlMacro.statement and org.swift.confluence.sql.SqlQueryMacro.statement
- Log statements will appear in the standard confluence log file
- Logging will occur immediately, but only last until Confluence is restarted
Tip | ||
---|---|---|
| ||
Setting or lowering the row limit in an installation may cause a few existing SQL queries to show only the limited number of rows. Use logging to track usage that exceeds the limit. Investigate queries that exceed the default limit for correctness. If correct, use the limit parameter to prevent further warnings. |
Tip | ||
---|---|---|
| ||
Setting additivity to false prevents sql being logged to your main confluence log. |
Example log
...
Include Page | ||||
---|---|---|---|---|
|