The following section contains some examples of different MimerTrace.config files. The correct configuration and XML tags are set up automatically if the Mimer SQL Data Provider Trace Control tool is used.
A trace configuration that enables tracing of all trace categories. A file trace listener is added without specifying a file name, therefore the trace output will be written to the default file called Mimer.Data.Client.log, located next to MimerTrace.config. DateTime and ProcessId information will be included with every trace message.
Information for all applications will be written to the file. autoFlush is enabled, which forces output from every operation to be written the file.
Please note that even though traceCategory is set to All, the actual output that appears in the trace file depends on the MimerConnection.ConnectionString attribute Allowed Trace Level. If it is set to safe, which is the default then SQL Statements and parameter values are not logged. Only if set to confidential will this information appear in the log file. The reason for this is that sensitive information and/or data about what a user is doing in an application may otherwise be shown. If Allowed Trace Level is none, no tracing is allowed. This may be used, for example, by a an application handling sensitive data in a hospital.
Similar to the configuration above, but the name of the log file has been specified for the trace output, and no traceOutputOptions are set.
Below is a trace configuration that enables tracing that includes SQL statements and SQL Parameter values (Note that MimerConnectionStringBuilder.AllowedTraceLevel must be set to 'confidential' to allow this type of tracing). A database listener is added and the database connection string where the trace output is logged in a database is specified.
When integrated security is set to true in the connection string the current operating system user will be used to login. The user logged in must have the right to login in as the User Id specified in the traceProviderConnectionString.
The following SQL commands create an ident call TraceUser and allows the operating system user abc to login as this user:
Earlier version of Mimer SQL used unqualified OS user names, eg. OS_USER 'abc'. TraceUser is granted databank privilege so that the Data Provider will be able to create a databank, sequence, and table to store the trace output.
A trace configuration that enables tracing of Errors. Trace output will be written to console.
In the first filtering sample three filters are added which includes tracing of connections where the Application Name is set to App1, excludes traces of databases database1 and database2, and only includes tracing of connections where the user is testuser. All three filter conditions must be fulfilled for a specific connection to be traced.
In the next sample, two filters are added which includes traces about database1 (but excludes all other databases), and excludes traces of the SYSADM user. This means that all connections to database1 where SYSADM is not the user will be traced.
Multiple trace listeners can be added by specifying several listeners.
The following section contains some examples of different MimerTrace.config files.
A trace configuration that enables tracing of all trace categories. A file, console, and database listener is added. Autoflush is enabled.
A trace configuration that enables tracing of SQL statements and SQL Parameters (Note that MimerConnectionStringBuilder.AllowedTraceLevel must be set to 'confidential' on the connection string(s) to get any output). A file listener, specifying a custom file, is added.