Logging
Logging
Capturing component logging can be very helpful when diagnosing error messages or other unexpected behavior.
Basic Logging
To begin capturing component logging, set these properties:
- Logfile: A filepath that designates the name and location of the log file.
- Verbosity: A numerical value (1-5) that determines the amount of detail in the log. See the page in the Connection Properties section for an explanation of the five levels.
- MaxLogFileSize: When the limit is hit, a new log is created in the same folder with the date and time appended to the end. The default limit is 100 MB. Values lower than 100 kB will use 100 kB as the value instead.
- MaxLogFileCount: A string specifying the maximum file count of log files. When the limit is hit, a new log is created in the same folder with the date and time appended to the end and the oldest log file will be deleted. Minimum supported value is 2. A value of 0 or a negative value indicates no limit on the count.
Once these properties are set, the component populates the log file as it carries out various tasks, such as when authentication is performed or queries are executed. If the specified file doesn't already exist, it is created.
Log Verbosity
The verbosity level determines the amount of detail that the component reports to the Logfile. Supported Verbosity levels range from 1 to 5.The following list describes each level:
| 1 | Setting Verbosity to 1 logs the query, the number of rows returned by it, the start of execution and the time taken, and any errors. |
| 2 | Setting Verbosity to 2 logs everything included in Verbosity 1 and additional information about the request. |
| 3 | Setting Verbosity to 3 also logs HTTP headers, as well as the body of the request and the response. |
| 4 | Setting Verbosity to 4 also logs transport-level communication with the data source. This includes SSL negotiation. |
| 5 | Setting Verbosity to 5 also logs communication with the data source and additional details that may be helpful in troubleshooting problems. This includes interface commands. |
For normal operations, Verbosity should not be set to greater than 1. At higher verbosities you can log substantial amounts of data, which can delay execution times.
To refine the logged content further by showing/hiding specific categories of information, see LogModules.
Sensitive Data
Verbosity levels of 3 and higher may capture information that you do not want shared outside of your organization. The following lists information of concern for each level:- Verbosity 3: The full body of the request and the response, which includes all the data returned by the component
- Verbosity 4: SSL certificates
- Verbosity 5: Any extra transfer data not included at Verbosity 3, such as non human-readable binary transfer data
Note: Although we mask sensitive values, such as passwords, in the connection string and any request in the log, it is always best practice to review the logs for any sensitive information before sharing outside your organization.
Advanced Logging
You may want to refine the exact information that is recorded to the log file. This can be accomplished using the LogModules property. This property allows you to filter the logging using a semicolon-separated list of logging modules.
Example property value:
LogModules=INFO;EXEC;SSL;SQL;META;
Note that the logfile filtering triggered by the Verbosity connection property takes precedence over the filtering imposed by this connection property. This means that operations of a higher verbosity level than the level specified in the Verbosity connection property are not printed in the logfile, even if they belong to one of the modules specified in this connection property.
The available modules and submodules are:
| Module Name | Module Description | Submodules |
| INFO | General Information. Includes the connection string, product version (build number), and initial connection messages. |
|
| EXEC | Query Execution. Includes execution messages for user-written SQL queries, parsed SQL queries, and normalized SQL queries. Success/failure messages for queries and query pages appear here as well. |
|
| HTTP | HTTP protocol messages. Includes HTTP requests/responses (including POST messages), as well as Kerberos related messages. |
|
| WSDL | Messages pertaining to the generation of WSDL/XSD files. | — |
| SSL | SSL certificate messages. |
|
| AUTH | Authentication related failure/success messages. |
|
| SQL | Includes SQL transactions, SQL bulk transfer messages, and SQL result set messages. |
|
| META | Metadata cache and schema messages. |
|
| FUNC | Information related to executing SQL functions. |
|
| TCP | Incoming and outgoing raw bytes on TCP transport layer messages. |
|
| FTP | Messages pertaining to the File Transfer Protocol. |
|
| SFTP | Messages pertaining to the Secure File Transfer Protocol. |
|
| POP | Messages pertaining to data transferred via the Post Office Protocol. |
|
| SMTP | Messages pertaining to data transferred via the Simple Mail Transfer Protocol. |
|
| CORE | Messages relating to various internal product operations not covered by other modules. | — |
| DEMN | Messages related to SQL remoting. | — |
| CLJB | Messages about bulk data uploads (cloud job). |
|
| SRCE | Miscellaneous messages produced by the product that don't belong in any other module. | — |
| TRANCE | Advanced messages concerning low-level product operations. | — |
| RSSIS | Messages related to SQL Integration Services (SSIS) component operations, including data flow execution, source and destination component interactions, and lookup transformations. |
|