trace

abstract fun trace(message: String, vararg args: Any?)

Logs a message at SentryLogLevel.TRACE level.

Parameters

message

The message template (use %s for substitution, %% for literal %)

args

Arguments to substitute into the message template via toString()


abstract fun trace(message: String, attributes: SentryAttributes.() -> Unit)

Logs a message at SentryLogLevel.TRACE level with inline attributes.

Example:

Sentry.logger.trace("Executing SQL query") {
this["db.name"] = "users"
this["db.operation"] = "SELECT"
}

Parameters

message

The log message

attributes

A lambda with SentryAttributes receiver to set key-value attributes


abstract fun trace(message: String, vararg args: Any?, attributes: SentryAttributes.() -> Unit)

Logs a message at SentryLogLevel.TRACE level with template parameters and inline attributes.

Example:

Sentry.logger.trace("Executing SQL query: %s", query) {
this["db.name"] = "users"
this["db.operation"] = "SELECT"
}

Parameters

message

The message template (use %s for substitution, %% for literal %)

args

Arguments to substitute into the message template via toString()

attributes

A lambda with SentryAttributes receiver to set key-value attributes


abstract fun trace(block: SentryLogBuilder.() -> Unit)

Logs a message at SentryLogLevel.TRACE level using a DSL builder.

Example:

Sentry.logger.trace {
message("Executing SQL query: %s", query)
attributes {
this["db.name"] = "users"
this["db.operation"] = "SELECT"
}
}

Parameters

block

A lambda with SentryLogBuilder receiver to configure the log entry