Skip to content
Structured logging solution.
Branch: master
Clone or download
Latest commit 1783773 May 23, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
log-base Changelog update. Apr 9, 2019
log-postgres OK, it's actually not, because hpqtypes. May 23, 2019
.gitignore Update .gitignore. Jun 19, 2017
.travis.yml Remove the 'log' library. Aug 10, 2017
LICENSE Remove the 'log' library. Aug 10, 2017
cabal.project Generate V5 files with "text" instead of the deprecated "string" Nov 16, 2018

log Hackage version Build Status

A set of libraries that provide a way to record structured log messages with multiple back ends.

Supported back ends:

  • Standard output
  • Elasticsearch
  • PostgreSQL

The log-base library provides only the basic scaffolding and the stdout back end. Additional back ends are provided by log-elasticsearch and log-postgres.


{-# 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"
You can’t perform that action at this time.