Skip to content

Allow customizing the logger middleware #413

@bensmrs

Description

@bensmrs

My application runs two Dream servers and I’m interested in having both use the logger middleware. However, the way it’s currently implemented, both show the dream.logger source, making debugging a bit tedious. Could we have logger take an optional sub_log? The lowest-effort patch could look like let logger ?(log=log) next_handler request = ..., thus allowing injecting one’s own sub-logger into the logger middleware, without breaking the signatures too much.
WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions