Tracer
Tracer
Section titled “Tracer”Defines a logging and tracing output method.
This object can be configured from the WebUI under Settings › Telemetry › Tracers
Fields
Section titled “Fields”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.
@type: "Log"
Section titled “@type: "Log"”Log file
Type:
String· requiredThe path to the log file
prefix
Section titled “prefix”Type:
String· default:"stalwart"The prefix for the log file
rotate
Section titled “rotate”Type:
LogRotateFrequency· default:"daily"The frequency to rotate the log file
Type:
Boolean· default:trueWhether to use ANSI colors in logs
multiline
Section titled “multiline”Type:
Boolean· default:falseWhether to write log entries as a single line or multiline
enable
Section titled “enable”Type:
Boolean· default:trueEnable or disable the tracer
Type:
TracingLevel· default:"info"The logging level for this tracer
Type:
Boolean· default:falseWhether to drop log entries if there is backlog
events
Section titled “events”Type:
EventType[]List of events to include or exclude based on filter mode
eventsPolicy
Section titled “eventsPolicy”Type:
EventPolicy· default:"exclude"How to interpret the events list
@type: "Stdout"
Section titled “@type: "Stdout"”Console
buffered
Section titled “buffered”Type:
Boolean· default:trueWhether to buffer log entries before writing to console
Type:
Boolean· default:falseWhether to use ANSI colors in logs
multiline
Section titled “multiline”Type:
Boolean· default:falseWhether to write log entries as a single line or multiline
enable
Section titled “enable”Type:
Boolean· default:trueEnable or disable the tracer
Type:
TracingLevel· default:"info"The logging level for this tracer
Type:
Boolean· default:falseWhether to drop log entries if there is backlog
events
Section titled “events”Type:
EventType[]List of events to include or exclude based on filter mode
eventsPolicy
Section titled “eventsPolicy”Type:
EventPolicy· default:"exclude"How to interpret the events list
@type: "Journal"
Section titled “@type: "Journal"”Systemd Journal
enable
Section titled “enable”Type:
Boolean· default:trueEnable or disable the tracer
Type:
TracingLevel· default:"info"The logging level for this tracer
Type:
Boolean· default:falseWhether to drop log entries if there is backlog
events
Section titled “events”Type:
EventType[]List of events to include or exclude based on filter mode
eventsPolicy
Section titled “eventsPolicy”Type:
EventPolicy· default:"exclude"How to interpret the events list
@type: "OtelHttp"
Section titled “@type: "OtelHttp"”Open Telemetry (HTTP)
endpoint
Section titled “endpoint”Type:
Uri· requiredThe endpoint for Open Telemetry
enableLogExporter
Section titled “enableLogExporter”Type:
Boolean· default:trueWhether to export logs to OpenTelemetry
enableSpanExporter
Section titled “enableSpanExporter”Type:
Boolean· default:trueWhether to export spans to OpenTelemetry
throttle
Section titled “throttle”Type:
Duration· default:"1s"The minimum amount of time that must pass between each request to the OpenTelemetry endpoint
timeout
Section titled “timeout”Type:
Duration· default:"10s"Maximum amount of time that Stalwart will wait for a response from the OpenTelemetry endpoint
httpAuth
Section titled “httpAuth”Type:
HttpAuth· requiredThe type of HTTP authentication to use
httpHeaders
Section titled “httpHeaders”Type:
Map<String, String>Additional headers to include in HTTP requests
enable
Section titled “enable”Type:
Boolean· default:trueEnable or disable the tracer
Type:
TracingLevel· default:"info"The logging level for this tracer
Type:
Boolean· default:falseWhether to drop log entries if there is backlog
events
Section titled “events”Type:
EventType[]List of events to include or exclude based on filter mode
eventsPolicy
Section titled “eventsPolicy”Type:
EventPolicy· default:"exclude"How to interpret the events list
@type: "OtelGrpc"
Section titled “@type: "OtelGrpc"”Open Telemetry (gRPC)
endpoint
Section titled “endpoint”Type:
Uri?The endpoint for Open Telemetry
enableLogExporter
Section titled “enableLogExporter”Type:
Boolean· default:trueWhether to export logs to OpenTelemetry
enableSpanExporter
Section titled “enableSpanExporter”Type:
Boolean· default:trueWhether to export spans to OpenTelemetry
throttle
Section titled “throttle”Type:
Duration· default:"1s"The minimum amount of time that must pass between each request to the OpenTelemetry endpoint
timeout
Section titled “timeout”Type:
Duration· default:"10s"Maximum amount of time that Stalwart will wait for a response from the OpenTelemetry endpoint
httpAuth
Section titled “httpAuth”Type:
HttpAuth· requiredThe type of HTTP authentication to use
httpHeaders
Section titled “httpHeaders”Type:
Map<String, String>Additional headers to include in HTTP requests
enable
Section titled “enable”Type:
Boolean· default:trueEnable or disable the tracer
Type:
TracingLevel· default:"info"The logging level for this tracer
Type:
Boolean· default:falseWhether to drop log entries if there is backlog
events
Section titled “events”Type:
EventType[]List of events to include or exclude based on filter mode
eventsPolicy
Section titled “eventsPolicy”Type:
EventPolicy· default:"exclude"How to interpret the events list
JMAP API
Section titled “JMAP API”The Tracer object is available via the urn:stalwart:jmap capability.
x:Tracer/get
Section titled “x:Tracer/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysTracerGet permission.
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" ] }'x:Tracer/set
Section titled “x:Tracer/set”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.
Create
Section titled “Create”This operation requires the sysTracerCreate permission.
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" ] }'Update
Section titled “Update”This operation requires the sysTracerUpdate permission.
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" ] }'Destroy
Section titled “Destroy”This operation requires the sysTracerDestroy permission.
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" ] }'x:Tracer/query
Section titled “x:Tracer/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysTracerQuery permission.
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.
stalwart-cli get Tracer id1Create
Section titled “Create”stalwart-cli create Tracer/Log \ --field path=Example \ --field 'events={}'stalwart-cli query TracerUpdate
Section titled “Update”stalwart-cli update Tracer id1 --field path='updated value'Delete
Section titled “Delete”stalwart-cli delete Tracer --ids id1Nested types
Section titled “Nested types”HttpAuth
Section titled “HttpAuth”Defines the HTTP authentication method to use for HTTP requests.
Unauthenticated: Anonymous. No additional fields.Basic: Basic Authentication. Carries the fields ofHttpAuthBasic.Bearer: Bearer Token. Carries the fields ofHttpAuthBearer.
HttpAuthBasic
Section titled “HttpAuthBasic”HTTP Basic authentication credentials.
username
Section titled “username”Type:
String· requiredUsername for HTTP Basic Authentication
secret
Section titled “secret”Type:
SecretKey· requiredPassword for HTTP Basic Authentication
SecretKey
Section titled “SecretKey”A secret value provided directly, from an environment variable, or from a file.
Value: Secret value. Carries the fields ofSecretKeyValue.EnvironmentVariable: Secret read from environment variable. Carries the fields ofSecretKeyEnvironmentVariable.File: Secret read from file. Carries the fields ofSecretKeyFile.
SecretKeyValue
Section titled “SecretKeyValue”A secret value provided directly.
secret
Section titled “secret”Type:
String· required · secretPassword or secret value
SecretKeyEnvironmentVariable
Section titled “SecretKeyEnvironmentVariable”A secret value read from an environment variable.
variableName
Section titled “variableName”Type:
String· requiredEnvironment variable name to read the secret from
SecretKeyFile
Section titled “SecretKeyFile”A secret value read from a file.
filePath
Section titled “filePath”Type:
String· requiredFile path to read the secret from
HttpAuthBearer
Section titled “HttpAuthBearer”HTTP Bearer token authentication.
bearerToken
Section titled “bearerToken”Type:
SecretKey· requiredBearer token for HTTP Bearer Authentication
LogRotateFrequency
Section titled “LogRotateFrequency”| Value | Label |
|---|---|
daily | Daily |
hourly | Hourly |
minutely | Minutely |
never | Never |
TracingLevel
Section titled “TracingLevel”| Value | Label |
|---|---|
error | Error |
warn | Warning |
info | Info |
debug | Debug |
trace | Trace |
EventPolicy
Section titled “EventPolicy”| Value | Label |
|---|---|
include | Only include the specified events |
exclude | Exclude the specified events |