Duplex logging filter - MSSQL

This filter can log any request or response packets to either the normal log output, or to a log file.

Be careful when logging responses -- it's easy to generate enormous amounts of logging and to fill up a disk.

Parameters

None of the parameters are required.

The parameters that can take multiple values can be separated by commas or by newlines.


File name

If specified, the logging output will be appended to this file. Keep in mind that this file is from the perspective of the Docker container: it's usually located in a shared filesystem, or in a Docker volume.

If this parameter is not specified, and the Logger name is not specified, the logging output goes to standard out.


Use timestamp

If specified, and the File name parameter is also specified, the file name will be given a timestamp representing when the logging started. The timestamp will be of the form YYYYMMDD-HHMMSS and will be inserted before the file extension, or at the end of the file name if not extension is specified.


Logger name

If specified, and the File name parameter is not specified, then this logger will be used for output. The specified name can be that of a pre-existing logger (e.g. galliumdata.uselog), or a new logger (e.g. My Logger).


Format

If specified, this string will be used as a template for the logging output entries.

Available variables:

  • $message: the message to be logged

  • $ts: a timestamp in the format yyyy-MM-dd HH:mm:ss.SSS

  • $user: the name of the database user, if available

  • $ip: the IP address of the database client

  • $thread: the ID of the thread running this filter


Packet types

A list of packet types to log, for instance SQLBatch, Row, NBCRow.

If no packet types are specified, then all packets are logged.


Client IPs

A list of IP addresses (IP4 and/or IP6) and/or regular expressions for IP addresses.

Example:

12.34.56.78
1234:5678:90ab::01
regex:98\.76\..*
regex:9876:5432:.*


Users

A list of user names and/or regular expressions for user names. If specified, only responses for these users will be logged.


Verbose

If this option is checked, the logging will be more verbose.


Filter

A Java regular expression. If specified, only messages that satisfy this expression will be logged.