implements error log reporting

This commit is contained in:
Keagan McClelland
2021-09-11 21:25:03 -06:00
parent 8a675b48fe
commit f2364e742e
6 changed files with 65 additions and 11 deletions

View File

@@ -52,6 +52,7 @@ import Yesod.Default.Config2
-- Don't forget to add new modules to your cabal file!
import Foundation
import Handler.Apps
import Handler.ErrorLogs
import Handler.Icons
import Handler.Version
import Handler.Marketplace
@@ -65,6 +66,7 @@ import Control.Arrow ((***))
import Network.HTTP.Types.Header ( hOrigin )
import Data.List (lookup)
import Network.Wai.Middleware.RequestLogger.JSON
import System.Directory (createDirectoryIfMissing)
-- This line actually creates our YesodDispatch instance. It is the second half
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the
@@ -96,6 +98,8 @@ makeFoundation appSettings = do
tempFoundation = mkFoundation $ panic "connPool forced in tempFoundation"
logFunc = messageLoggerSource tempFoundation appLogger
createDirectoryIfMissing True (errorLogRoot appSettings)
-- Create the database connection pool
pool <- flip runLoggingT logFunc $ createPostgresqlPool
(pgConnStr $ appDatabaseConf appSettings)