log: Structured logging solution with multiple backends

[ bsd3, deprecated, library, system ] [ Propose Tags ]
Deprecated in favor of log-base, log-postgres, log-elasticsearch
Versions [RSS] 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.4, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.6, 0.7, 0.8, 0.9.0.0, 0.9.0.1
Change log CHANGELOG.md
Dependencies 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) [details]
License BSD-3-Clause
Copyright Scrive AB
Author Scrive AB
Maintainer Andrzej Rybczak <andrzej@rybczak.net>, Jonathan Jouty <jonathan@scrive.com>, Mikhail Glushenkov <mikhail@scrive.com>, Oleg Grenrus <oleg.grenrus@iki.fi>
Category System
Home page https://github.com/scrive/log
Source repo head: git clone https://github.com/scrive/log.git
Uploaded by MikhailGlushenkov at 2017-06-20T16:22:37Z
Distributions
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 15373 total (75 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-06-20 [all 1 reports]

Readme for log-0.9.0.1

[back to package description]

log Hackage version Build Status

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"