Access Logger
Sword can log one line per RPC once the response is sent: path, short status code, latency and a truncated request id. This is separate from the global [tracing] subscriber and is driven entirely by the [grpc.logger] section.
The logger is off unless the section is present.
Configuration
toml
[grpc.logger]
enabled = true
level = "auto"
skip-paths = [
"/grpc.health.v1.Health/Check",
"/grpc.reflection.v1.ServerReflection/ServerReflectionInfo",
]| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enables or disables the logger |
level | auto | info | auto | Log level policy. See Levels |
skip-paths | String[] | [] | RPC paths to exclude from logging (exact or prefix match) |
Levels
infologs every RPC atINFOregardless of the status code.autopicks the level from the gRPC status code read from thegrpc-statusresponse header:
| Code | Level |
|---|---|
ok | INFO |
| client errors | WARN |
| server errors (the rest) | ERROR |
Request Identifier
The logger reuses the x-request-id header set by the built-in RequestIdLayer, which is also applied to gRPC requests for correlation. When present, the logger logs only the first 8 characters; otherwise it uses a - placeholder.

