Skip to content

Instance Property

queryLogLevel

The logging level used for reporting queries run on the given database to the database’s logger. Defaults to .debug.
var queryLogLevel: Logger.Level? { get }

Discussion

This log level applies only to logging the serialized SQL text and bound parameter values (if any) of queries; it does not affect any logging performed by the underlying driver or any other subsystem. If the value is nil, query logging is disabled.

Important

Conforming drivers must provide a means to configure this value and to use the default .debug level if no explicit value is provided. It is also the responsibility of the driver to actually perform the query logging, including respecting the logging level.

The lack of enforcement of these requirements is obviously less than ideal, but for the moment it’s unavoidable, as there are no direct entry points to SQLKit without a driver.

Default Implementations

SQLDatabase Implementations

  • var queryLogLevel: Logger.Level?
    Drivers which do not provide the queryLogLevel-991s4 property must be given the automatic default of .debug. It would be preferable not to provide a default conformance, but as the property was another late addition to the protocol, it is required for source compatibility.

See Also

Properties