mozilla-services / common-rs

Common utilities for Mozilla server side apps
Mozilla Public License 2.0
3 stars 9 forks source link

tracing-actix-web-mozlog: Add layer that can configure the fallback layer for the `type` field #28

Open mythmon opened 2 years ago

mythmon commented 2 years ago

Currently the mozlog formatter uses "<unknown>" as a value for any event that doesn't have a type field. This should be configurable by users of the library. One way this could be done is to add an optional layer that users can add that fills in a value for this field if none is provided by passing events to a bit of user-specified code. That code could inspect the event and determine the proper type.

Any events that arrive via the log facade's shim can't have a type field, which is a case we'll need to be able to handle. To that end it should be possible to determine where the event came from in the fallback code provided.