Skip to content

Tracer

Defines a logging and tracing output method.

This object can be configured from the WebUI under Settings › Telemetry › Tracers

Tracer is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.

Log file

Type: String · required

The path to the log file

Type: String · default: "stalwart"

The prefix for the log file

Type: LogRotateFrequency · default: "daily"

The frequency to rotate the log file

Type: Boolean · default: true

Whether to use ANSI colors in logs

Type: Boolean · default: false

Whether to write log entries as a single line or multiline

Type: Boolean · default: true

Enable or disable the tracer

Type: TracingLevel · default: "info"

The logging level for this tracer

Type: Boolean · default: false

Whether to drop log entries if there is backlog

Type: EventType[]

List of events to include or exclude based on filter mode

Type: EventPolicy · default: "exclude"

How to interpret the events list

Console

Type: Boolean · default: true

Whether to buffer log entries before writing to console

Type: Boolean · default: false

Whether to use ANSI colors in logs

Type: Boolean · default: false

Whether to write log entries as a single line or multiline

Type: Boolean · default: true

Enable or disable the tracer

Type: TracingLevel · default: "info"

The logging level for this tracer

Type: Boolean · default: false

Whether to drop log entries if there is backlog

Type: EventType[]

List of events to include or exclude based on filter mode

Type: EventPolicy · default: "exclude"

How to interpret the events list

Systemd Journal

Type: Boolean · default: true

Enable or disable the tracer

Type: TracingLevel · default: "info"

The logging level for this tracer

Type: Boolean · default: false

Whether to drop log entries if there is backlog

Type: EventType[]

List of events to include or exclude based on filter mode

Type: EventPolicy · default: "exclude"

How to interpret the events list

Open Telemetry (HTTP)

Type: Uri · required

The endpoint for Open Telemetry

Type: Boolean · default: true

Whether to export logs to OpenTelemetry

Type: Boolean · default: true

Whether to export spans to OpenTelemetry

Type: Duration · default: "1s"

The minimum amount of time that must pass between each request to the OpenTelemetry endpoint

Type: Duration · default: "10s"

Maximum amount of time that Stalwart will wait for a response from the OpenTelemetry endpoint

Type: HttpAuth · required

The type of HTTP authentication to use

Type: Map<String, String>

Additional headers to include in HTTP requests

Type: Boolean · default: true

Enable or disable the tracer

Type: TracingLevel · default: "info"

The logging level for this tracer

Type: Boolean · default: false

Whether to drop log entries if there is backlog

Type: EventType[]

List of events to include or exclude based on filter mode

Type: EventPolicy · default: "exclude"

How to interpret the events list

Open Telemetry (gRPC)

Type: Uri?

The endpoint for Open Telemetry

Type: Boolean · default: true

Whether to export logs to OpenTelemetry

Type: Boolean · default: true

Whether to export spans to OpenTelemetry

Type: Duration · default: "1s"

The minimum amount of time that must pass between each request to the OpenTelemetry endpoint

Type: Duration · default: "10s"

Maximum amount of time that Stalwart will wait for a response from the OpenTelemetry endpoint

Type: HttpAuth · required

The type of HTTP authentication to use

Type: Map<String, String>

Additional headers to include in HTTP requests

Type: Boolean · default: true

Enable or disable the tracer

Type: TracingLevel · default: "info"

The logging level for this tracer

Type: Boolean · default: false

Whether to drop log entries if there is backlog

Type: EventType[]

List of events to include or exclude based on filter mode

Type: EventPolicy · default: "exclude"

How to interpret the events list

The Tracer object is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysTracerGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tracer/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This is a standard Foo/set method as defined in RFC 8620, Section 5.3.

Supports create, update, and destroy operations in a single call.

This operation requires the sysTracerCreate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tracer/set",
{
"create": {
"new1": {
"@type": "Log",
"events": {},
"path": "Example"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysTracerUpdate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tracer/set",
{
"update": {
"id1": {
"path": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysTracerDestroy permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tracer/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysTracerQuery permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tracer/query",
{
"filter": {}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get Tracer id1
Terminal window
stalwart-cli create Tracer/Log \
--field path=Example \
--field 'events={}'
Terminal window
stalwart-cli query Tracer
Terminal window
stalwart-cli update Tracer id1 --field path='updated value'
Terminal window
stalwart-cli delete Tracer --ids id1

Defines the HTTP authentication method to use for HTTP requests.

  • Unauthenticated: Anonymous. No additional fields.
  • Basic: Basic Authentication. Carries the fields of HttpAuthBasic.
  • Bearer: Bearer Token. Carries the fields of HttpAuthBearer.

HTTP Basic authentication credentials.

Type: String · required

Username for HTTP Basic Authentication

Type: SecretKey · required

Password for HTTP Basic Authentication

A secret value provided directly, from an environment variable, or from a file.

A secret value provided directly.

Type: String · required · secret

Password or secret value

A secret value read from an environment variable.

Type: String · required

Environment variable name to read the secret from

A secret value read from a file.

Type: String · required

File path to read the secret from

HTTP Bearer token authentication.

Type: SecretKey · required

Bearer token for HTTP Bearer Authentication

ValueLabel
dailyDaily
hourlyHourly
minutelyMinutely
neverNever
ValueLabel
errorError
warnWarning
infoInfo
debugDebug
traceTrace
ValueLabel
includeOnly include the specified events
excludeExclude the specified events