@hackage log0.9.0.1
Structured logging solution with multiple backends
Categories
License
BSD-3-Clause
Maintainer
Andrzej Rybczak <andrzej@rybczak.net>, Jonathan Jouty <jonathan@scrive.com>, Mikhail Glushenkov <mikhail@scrive.com>, Oleg Grenrus <oleg.grenrus@iki.fi>
Links
Versions
Deprecated
Tested Compilers
Dependencies (4)
- base <5
- log-base >=0.7.1.1 && <0.9
- log-elasticsearch >=0.9.0.1 && <0.10
- log-postgres >=0.7.0.1 && <0.9 Show all…
Dependents (4)
@hackage/consumers, @hackage/hpqtypes-extras, @hackage/acme-everything, @hackage/log-utils
log

A library that provides a way to record structured log messages with multiple back ends.
Supported back ends:
- Standard output
- Elasticsearch
- PostgreSQL
The log library provides Elasticsearch and PostgreSQL back ends. If
you only need one of those, use log-base and log-elasticsearch or
log-postgres.
Example
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Log
import Log.Backend.ElasticSearch.V5
import System.Random
main :: IO ()
main = do
let config = defaultElasticSearchConfig {
esServer = "http://localhost:9200",
esIndex = "logs",
esMapping = "log"
}
withElasticSearchLogger config randomIO $ \logger ->
runLogT "main" logger $ do
logTrace_ "foo"