log-base-0.8.0.0: Structured logging solution (base package)

Safe HaskellNone
LanguageHaskell2010

Log

Contents

Description

Structured logging solution with multiple backends.

{-# LANGUAGE OverloadedStrings #-}

module Main where

import Log
import Log.Backend.ElasticSearch

import System.Random

main :: IO ()
main = do
  let config = ElasticSearchConfig {
        esServer  = "http://localhost:9200",
        esIndex   = "logs",
        esMapping = "log"
        }
  withElasticSearchLogger config randomIO $ \logger -> do
    runLogT "main" logger $ do
      logTrace_ "foo"
Synopsis

Documentation

MonadLog type class of monads with logging capabilities.

module Log.Class

LogMessage and LogLevel data definitions.

module Log.Data

Logger objects used to perform logging operations in LogT.

module Log.Logger

LogT monad transformer that adds logging capabilities to the underlying monad.

module Log.Monad

Aeson re-exports

object :: [Pair] -> Value #

Create a Value from a list of name/value Pairs. If duplicate keys arise, earlier keys and their associated values win.

(.=) :: (KeyValue kv, ToJSON v) => Text -> v -> kv infixr 8 #