monad-logger-json: JSON-friendly Logging APIs

[ library, logging, mit ] [ Propose Tags ]

Convienence functions for logging ToJSON with monad-logger

[Skip to Readme]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS]
Dependencies aeson, base (>=4.6 && <5), monad-logger, template-haskell, text [details]
License MIT
Author FP Complete Developers
Category Logging
Home page
Source repo head: git clone
Uploaded by dysinger at 2015-03-31T22:54:15Z
Distributions LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1517 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-20 [all 1 reports]

Readme for monad-logger-json-

[back to package description]

Monad Logger functions for JSON

TravisCI Hackage


As a library:

cabal install monad-logger-json

Usage (example)

{-# LANGUAGE TemplateHaskell #-}

import Control.Monad.IO.Class ( MonadIO(liftIO) )
import Control.Monad.Logger ( runStdoutLoggingT )
import Control.Monad.Logger.JSON ( logInfoJ, logDebugJ )
import Data.Aeson.TH ( defaultOptions, deriveJSON )
import Data.Time.Clock ( UTCTime, getCurrentTime )

data Message = Message { time :: UTCTime }

$( deriveJSON defaultOptions ''Message )

main :: IO ()
main =
    (do now <- liftIO getCurrentTime
        $logDebugJ (Message now)
        $logInfoJ "Hello world")