Access Logger
Sword can log one line per RPC once the response is sent. The line includes the path, the gRPC status code, the latency and the 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 |
Log fields
| Field | Description |
|---|---|
status | gRPC status code, rendered from Code (for example Ok, InvalidArgument). |
latency | Time spent handling the RPC, formatted from Duration (e.g. 1.234ms). |
request_id | x-request-id value, or - when the header is missing. |
rpc | RPC path, for example /users.UserService/GetUser. |
RPCs matching skip-paths are neither measured nor logged.
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. The full value is logged. When the header is missing, it uses a - placeholder.

