Skip to content

Commit

Permalink
Fix dev request logger has been used in production
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Nov 23, 2020
1 parent 2979243 commit da199d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions IHP/FrameworkConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import qualified System.Directory as Directory
import qualified Data.Text as Text
import qualified System.Process as Process
import Network.Wai (Middleware)
import qualified Network.Wai.Middleware.RequestLogger as RequestLogger (logStdoutDev)
import qualified Network.Wai.Middleware.RequestLogger as RequestLogger
import qualified Web.Cookie as Cookie
import Data.Default (def)
import Data.Time.Clock (NominalDiffTime)
Expand Down Expand Up @@ -81,7 +81,11 @@ ihpDefaultConfig = do
port <- liftIO defaultAppPort
option $ AppPort port

option $ RequestLoggerMiddleware defaultLoggerMiddleware
environment <- findOption @Environment
option $ RequestLoggerMiddleware $
case environment of
Development -> RequestLogger.logStdoutDev
Production -> RequestLogger.logStdout

option $ Sendmail

Expand Down Expand Up @@ -200,9 +204,6 @@ defaultIHPSessionCookie baseUrl = def

data RootApplication = RootApplication deriving (Eq, Show)

defaultLoggerMiddleware :: Middleware
defaultLoggerMiddleware = RequestLogger.logStdoutDev

defaultPort :: Int
defaultPort = 8000

Expand Down

0 comments on commit da199d1

Please sign in to comment.