Configure logging
Set the process-wide logging options in the[Log] section:
The defaults are
Format = "json" and Level = "info". Level filtering is
inclusive: warn emits warnings and errors, while debug emits every level.
The values are case-insensitive.
Configuration errors are reported when the configuration is loaded. At
startup, invalid logging settings cause the Kernel to use its defaults. During
a reload, an invalid configuration leaves the current configuration in effect.
Changes to [Log] take effect when the Kernel creates its logger at startup;
reloading the configuration updates runtime settings such as services, but does
not replace the logger that is already running.
Common fields
Every Kernel log identifies its origin with two fields:component identifies the trust boundary that produced the record. from
identifies the Kernel subsystem. Common values include:
httpfor HTTP access records;service_managerfor service discovery and lifecycle records; andconfig,server, andclifor configuration, server, and command-line activity.
wasm and grpc services; a static
service has no running process and so never emits its own log records. The
service protocol itself is unchanged; attribution is added by the Kernel’s
host logging layer.
Debug source locations
WhenLevel = "debug", the logger automatically adds source with the
application call site. This is useful for locating the code that emitted a
diagnostic record, but it increases the size of every record and usually
increases log volume as well.
Do not confuse source with from:
sourceis the debug-only logger call location; andfromis the stable Kernel subsystem or service identity.
info, warn, and error levels, the call-site source field is omitted.
HTTP access logs
The Kernel emits one access record after every HTTP request, including requests handled by Kernel routes and service routes, whether a route is handled dynamically or serves packaged files through a static transport. Each record contains:
The access record uses
component=kernel and from=http. Its log level is
selected from the final status:
4xxresponses are logged atWARN;5xxresponses are logged atERROR; and- all other responses are logged at
INFO.
Choosing a level
Useinfo for normal operation. It includes HTTP access records and service
lifecycle records.
Use warn when you need to investigate rejected requests, unavailable
namespaces, or other recoverable conditions. Use error when investigating
failed requests or operations.
Use debug temporarily when diagnosing route selection, successful event
handling, or the exact call site of a log record. Return to info after
diagnosis to reduce volume and avoid collecting more diagnostic detail than
necessary.