log-elasticsearch: Structured logging solution (Elasticsearch back end)

[ bsd3, library, system ] [ Propose Tags ]

Elasticsearch back end for the log library suite. Depends on 'log-base'.

[Skip to Readme]


Automatic Flags

Use http-client-openssl instead of http-client-tls


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Versions [RSS] 0.7, 0.8, 0.8.1,,,,,,,,,,,,,,
Change log CHANGELOG.md
Dependencies aeson (>=1.0), aeson-pretty (>=0.8.2), base (>=4.13 && <5), base64-bytestring, bytestring, deepseq, http-client, http-client-openssl (>=0.3.2), http-client-tls, http-types, log-base (>=0.10 && <0.13), network-uri, semigroups, text, text-show (>=2), time (>=1.5), transformers, unliftio-core (>=0.2), unordered-containers, vector [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 arybczak at 2023-01-31T09:21:40Z
Distributions NixOS:
Reverse Dependencies 1 direct, 3 indirect [details]
Downloads 8217 total (60 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for log-elasticsearch-

[back to package description]


Hackage version Build Status

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

Supported backends:


A sample usage for logging to both standard output and Elasticsearch:

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Log
import Log.Backend.ElasticSearch
import Log.Backend.StandardOutput

main :: IO ()
main = do
  let config = defaultElasticSearchConfig
        { esServer = "http://localhost:9200"
        , esIndex  = "logs"
  withStdOutLogger $ \stdoutLogger -> do
    withElasticSearchLogger config $ \esLogger -> do
      runLogT "main" (stdoutLogger <> esLogger) defaultLogLevel $ do
        logInfo_ "Hi there"