diff options
Diffstat (limited to 'Biz/Devalloc.hs')
-rw-r--r-- | Biz/Devalloc.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Biz/Devalloc.hs b/Biz/Devalloc.hs index 842cf24..2efd8fb 100644 --- a/Biz/Devalloc.hs +++ b/Biz/Devalloc.hs @@ -101,7 +101,6 @@ import Network.HTTP.Req ((/:), (=:)) import qualified Network.HTTP.Req as Req import qualified Network.Wai as Wai import qualified Network.Wai.Handler.Warp as Warp -import Network.Wai.Middleware.RequestLogger (logStdout) import Servant import Servant.API.Generic (ToServantApi, genericApi, toServant, (:-)) import qualified Servant.Auth as Auth @@ -478,7 +477,18 @@ tidy :: Config -> IO () tidy Config {..} = Directory.removeDirectoryRecursive keep run :: (Config, Wai.Application, Acid.AcidState Keep) -> IO () -run (cfg, app, _) = Warp.run (port cfg) (logStdout app) +run (cfg, app, _) = Warp.run (port cfg) (logMiddleware app) + +logMiddleware :: Wai.Middleware +logMiddleware app req sendResponse = + app req <| \res -> + Log.info + [ str <| Wai.requestMethod req, + show <| Wai.remoteHost req, + str <| Wai.rawPathInfo req + ] + >> Log.br + >> sendResponse res liveCookieSettings :: Auth.CookieSettings liveCookieSettings = |