BSD-3-Clause licensed by Scrive AB
This version can be pinned in stack with:log-base-0.12.1.0@sha256:84f761eee4f60aadbbc7925754550684c0d9bdba714d0c1321be845d9a77a183,2758
Module documentation for 0.12.1.0
Depends on 16 packages
(full list with versions):
aeson, 
aeson-pretty, 
base, 
bytestring, 
deepseq, 
exceptions, 
mmorph, 
monad-control, 
mtl, 
semigroups, 
stm, 
text, 
time, 
transformers-base, 
unliftio-core, 
unordered-containers log
 

A set of libraries that provide a way to record structured log messages with
multiple backends.
Supported backends:
Example
A sample usage for logging to both standard output and Elasticsearch:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Log
import Log.Backend.ElasticSearch
import Log.Backend.StandardOutput
main :: IO ()
main = do
  let config = defaultElasticSearchConfig
        { esServer = "http://localhost:9200"
        , esIndex  = "logs"
        }
  withStdOutLogger $ \stdoutLogger -> do
    withElasticSearchLogger config $ \esLogger -> do
      runLogT "main" (stdoutLogger <> esLogger) defaultLogLevel $ do
        logInfo_ "Hi there"
log-base-0.12.1.0 (2025-06-26)
- Add utility function to log unhandled exceptions.
log-base-0.12.0.1 (2023-03-14)
log-base-0.12.0.0 (2022-09-21)
- Deprecate withSimpleStdOutLoggeras it’s broken in multithreaded environments.
- Generalize logger related functions to MonadUnliftIO.
- Remove redundant INLINEpragmas.
log-base-0.11.1.0 (2022-04-04)
- Add support for aeson 2.0.1.0.
- Add support for GHC 9.2.
- Drop support for GHC < 8.8.
log-base-0.11.0.0 (2021-10-11)
- Add support for defining maximum log level.
log-base-0.10.0.1 (2021-07-29)
- Fix compilation issues caused by ambiguos occurence of controlT.
log -base-0.10.0.0 (2021-06-09)
- Drop MonadTimeconstraint and use system time by default.
log-base-0.9.1.1 (2021-05-28)
log-base-0.9.1.0 (2021-03-01)
log-base-0.9.0.0 (2020-09-07)
- Always make data attached to a log message a json object
- Add unliftio-core-0.2 compatiblity
- Tidy up flushing stdout in stdout loggers
- Use simpleStdoutLoggerinwithSimpleStdOutLoggerinstead ofstdoutLogger
- Remove deprecated functions
- Add JSON loggers
- Make mkLoggeruse bounded queue internally (similar tomkBulkLogger)
- Get rid of a space leak in bounded queue used in mkBulkLogger
log-base-0.8.0.1 (2020-05-08)
log-base-0.8.0.0 (2019-04-09)
- Add getLoggerEnvfunction toMonadLogclass, addgetLoggerIOutility (#46).
- Add a MonadUnliftIOinstance forLogT(#47).
log-base-0.7.4.0 (2017-10-27)
log-base-0.7.3.0 (2017-10-10)
- BasicStdOutLoggernow flushes stdout on each write.- BulkStdOutLoggernow flushes stdout on each bulk write (#38).
log-base-0.7.2.0 (2017-08-10)
- Add ‘MFunctor LogT’ instance (#35 ).
log-base-0.7.1.1 (2017-06-19)
- mkBulkLogger now uses a bounded queue to interact with the logger thread.
log-base-0.7.1 (2017-03-16)
- Added a few MTL class instances (#28).
log-base-0.7 (2016-11-25)
- Initial release (split from the log package).
- Improved documentation (#22).
- Implement ‘toEncoding’ directly in ‘ToJSON’ instances (#21).