You can configure external data sources to log details of each SQL query, including:
To configure a data source to log queries, add a Parameter element to the labkey.xml file. For example, the following template uses a data source named “mySqlDataSource".
<Resource name="jdbc/mySqlDataSource"
auth="Container"
type="javax.sql.DataSource"
username="myname"
password="mypassword"
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/?autoReconnect=true&
useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL"
maxTotal="20"
maxIdle="10"
maxWaitMillis="120000"
useInformationSchema="true"
accessToUnderlyingConnectionAllowed="true"
validationQuery="/* ping */"
/>
Add the following Parameter element. Note that ":LogQueries" has been appended to the name of the data source.
<Parameter name="mySqlDataSource:LogQueries" value="true"/>
The labkeyDataSource cannot be configured to log queries in this way. Doing so will cause a warning in the server log at startup -- then startup will proceed as normal.
Logged SQL queries can be viewed in the Audit Log.
previousnext |
expand allcollapse all |