log-0.9.0.1: README.md
# log [](https://hackage.haskell.org/package/log) [](http://travis-ci.org/scrive/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
```haskell
{-# 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"
```