katip: A structured logging framework.

[ bsd3, data, library, logging, text ] [ Propose Tags ] [ Report a vulnerability ]

Katip is a structured logging framework. See README.md for more details.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
lib-werrorDisabled

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

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.3.0.0, 0.3.1.0, 0.3.1.1, 0.3.1.2, 0.3.1.3, 0.3.1.4, 0.3.1.5, 0.4.0.0, 0.4.1.0, 0.5.0.0, 0.5.0.1, 0.5.0.2, 0.5.0.3, 0.5.0.4, 0.5.1.0, 0.5.2.0, 0.5.3.0, 0.5.4.0, 0.5.5.0, 0.5.5.1, 0.6.0.0, 0.6.1.0, 0.6.2.0, 0.6.2.1, 0.6.3.0, 0.7.0.0, 0.8.0.0, 0.8.1.0, 0.8.2.0, 0.8.3.0, 0.8.4.0, 0.8.5.0, 0.8.6.0, 0.8.7.0, 0.8.7.1, 0.8.7.2, 0.8.7.3, 0.8.7.4, 0.8.8.0, 0.8.8.1, 0.8.8.2
Change log changelog.md
Dependencies aeson (>=0.6 && <1.6), async (>=2.1.0 && <3.0.0.0), auto-update (>=0.1), base (>=4.9.0.0 && <5), bytestring (>=0.9), containers (>=0.4), either (>=4), hostname (>=1.0), microlens (>=0.2.0.0), microlens-th (>=0.1.0.0), monad-control (>=1.0), mtl (>=2.0 && <2.3), old-locale (>=1.0), resourcet (>=1.2.0), safe-exceptions (>=0.1.0.0), scientific (>=0.3.3.0), semigroups, stm (>=2.4.4.1), string-conv (>=0.1), template-haskell (>=2.8), text (>=0.11 && <1.3), time (>=1), transformers (>=0.3), transformers-base (>=0.3), transformers-compat, unix (>=2.5 && <2.8), unliftio-core (>=0.1), unordered-containers (>=0.2), Win32 (>=2.3 && <2.9) [details]
Tested with ghc ==8.0.1, ghc ==8.2.2, ghc ==8.4.3
License BSD-3-Clause
Copyright Soostone Inc, 2015-2017
Author Ozgun Ataman, Michael Xavier
Maintainer michael.xavier@soostone.com
Revised Revision 2 made by sjakobi at 2022-05-20T00:31:52Z
Category Data, Text, Logging
Home page https://github.com/Soostone/katip
Bug tracker https://github.com/Soostone/katip/issues
Source repo head: git clone https://github.com/Soostone/katip.git
Uploaded by MichaelXavier at 2020-08-17T19:51:37Z
Distributions LTSHaskell:0.8.8.2, NixOS:0.8.8.2, Stackage:0.8.8.2
Reverse Dependencies 37 direct, 12 indirect [details]
Downloads 45657 total (221 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-08-17 [all 1 reports]

Readme for katip-0.8.5.0

[back to package description]

Katip Build Status

Katip is a structured logging framework for Haskell.

Katip

Kâtip (pronounced kah-tip) is the Turkish word for scribe.

Features

  • Structured: Logs are structured, meaning they can be individually tagged with key value data (JSON Objects). This helps you add critical details to log messages before you need them so that when you do, they are available. Katip exposes a typeclass for log payloads so that you can use rich, domain-specific Haskell types to add context that will be automatically merged in with existing log context.

  • Easy to Integration: Katip was designed to be easily integrated into existing monads. By using typeclasses for logging facilities, individual subsystems and even libraries can easily add their own namespacing and context without having any knowledge of their logging environment.

  • Practical Use: Katip comes with a set of convenience facilities built-in, so it can be used without much headache even in small projects.

    • A Handle backend for logging to files in simple settings.

    • A AnyLogPayload key-value type that makes it easy to log structured columns on the fly without having to define new data types.

    • A Monadic interface where logging namespace can be obtained from the monad context.

    • Multiple variants of the fundamental logging functions for optionally including fields and line-number information.

  • Extensible: Can be easily extended (even at runtime) to output to multiple backends at once (known as scribes). See katip-elasticsearch as an example. Backends for other forms of storage are trivial to write, including both hosted database systems and SaaS logging providers.

  • Debug-Friendly: Critical details for monitoring production systems such as host, PID, thread id, module and line location are automatically captured. User-specified attributes such as environment (e.g. Production, Test, Dev) and system name are also captured.

  • Configurable: Can be adjusted on a per-scribe basis both with verbosity and severity.

    • Verbosity dictates how much of the log structure should actually get logged. In code you can capture highly detailed metadata and decide how much of that gets emitted to each backend.

    • Severity AKA "log level" is specified with each message and individual scribes can decide whether or not to record that severity. It is even possible to at runtime swap out and replace loggers, allowing for swapping in verbose debug logging at runtime if you want.

  • Battle-Tested: Katip has been integrated into several production systems since 2015 and has logged hundreds of millions of messages to files and ElasticSearch.

Examples

Be sure to look in the examples directory for some examples of how to integrate Katip into your own stack.

Contributors