Logging with the SQL Module
The SQL module uses the Akula Server's Logback logging mechanism. You can configure the logging mechanism to provide additional details about the actions of the SQL module.
You can configure logging for the SQL module to log data based individual statements within the SQL mapper file or for all statements within the SQL mapper file. You can also set the log level to capture the SQL module output, or the SQL statements that are executed.
To customize the log messages for the SQL module:
- Edit the log configuration file. This file is typically in the
AKULA_HOME/globaldirectory or in the Akula project's root directory.
nameattribute to match the root
namespaceattribute. This uses the following syntax:
<logger name=" namespace_name[ . statementID] ">
statementIDis optional, but refers to individual statements within the namespace of the SQL mapper file.
For example, if your SQL mapper file sets the
namespaceattribute to "Tasks":
In your log configuration file, set the
nameattribute to "Tasks" to apply the logging to all statements in the SQL mapper file:
To log entries only for specific statements within the SQL mapper file, use dot-notation syntax to specify the individual statements.
The following example logs entries for the "SelectOneList" statement within the Tasks namespace:
You can log multiple, separate statements by adding an additional
<logger>element, and setting a different value for the
nameattribute. Note that each logger must specify the
<appender-ref>; for example:
- Set the value of the
levelattribute. If you set this to DEBUG, then Akula logs the SQL statements and parameters. If you set this to TRACE, then Akula logs the SQL module results, in addition to the SQL statements and parameters. The previous example sets the level to TRACE.
- Save the log configuration file.
- Restart your Java app server for the changes to take effect.
For more information about using Akula Server's logging, see Configure Logging.