You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the wasmtime serve always prefixes the stdout and stderr output of http handlers. This prevents users from implementing structured logs like json.
Expected behaviour
logging from http handler in json will be logged by wasmtime serve as-is, without any prefixes.
If wasmtime serve allows customizing log prefixes, it would allow users to implement structured logging at their http handlers, like json, so the stdout and stderr logs from wasmtime serve can be easily parsed by popular log management tools like Grafana Loki and AWS CloudWatch
Implementation
Hopefully it's as simple as adding a coupld CLI flags, to make
Sounds reasonable to me to have some CLI flags for this yeah, would you be interested in sending a PR? Perhaps we could start out with a flag to just turn off the prefixes?
@alexcrichton : I'm fairly new to Rust and WASM, but with your encouragement I've created a PR for this. Please take a look and let me know your feedbacks. Thank you!
Feature
Currently, the
wasmtime serve
always prefixes the stdout and stderr output of http handlers. This prevents users from implementing structured logs like json.Expected behaviour
logging from http handler in json will be logged by
wasmtime serve
as-is, without any prefixes.Actual behaviour
handler logs are prefixed with
stdout [{req_id}] ::
.Benefit
If
wasmtime serve
allows customizing log prefixes, it would allow users to implement structured logging at their http handlers, like json, so the stdout and stderr logs from wasmtime serve can be easily parsed by popular log management tools like Grafana Loki and AWS CloudWatchImplementation
Hopefully it's as simple as adding a coupld CLI flags, to make
wasmtime/src/commands/serve.rs
Lines 141 to 149 in 9aa048b
Alternatives
No workarounds/alternatives I could think of.
The text was updated successfully, but these errors were encountered: