Skip to content

toWaiApp (mkDefaultMiddlewares) hardcodes outputFormat to wai-extra #1899

@Javran

Description

@Javran

I tried to change the log format by overriding makeLogger and messageLoggerSource of Yesod instance and realized there is one place sticking with its original log formatting: mkDefaultMiddlewares: note that it is hardcoded to pass outputFormat = Apache FromSocket as settings to wai-extra.

I wonder if there are existing discussions about making this more flexible (e.g. passing a custom OutputFormat)? Maybe an toWaiAppWith with a config ADT, maybe this also offers some more flexibility than having to choose between toWaiApp and toWaiAppPlain?

For those curious about workarounds, I ended up copying over implementation toWaiApp and its depdendencies to remove logWare from it, and utilize warp's setLogger instead.
Though I think keeping logWare and customizing its OutputFormat setting is also viable.

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