log-warper-1.4.0: Flexible, configurable, monadic and pretty logging

Copyright(c) Serokell 2016
LicenseGPL-3 (see the file LICENSE)
MaintainerSerokell <hi@serokell.io>
Stabilityexperimental
PortabilityPOSIX, GHC
Safe HaskellNone
LanguageHaskell2010

System.Wlog.Launcher

Description

Parser for configuring and initializing logger from YAML file. Logger configuration should look like this:

rotation:                # [optional] parameters for logging rotation
    logLimit: 1024       # max size of log file in bytes
    keepFiles: 3         # number of files with logs to keep including current one
node:                    # logger named «node»
    severity: Warning    # severity for logger «node»
    comm:                # logger named «node.comm»
        severity: Info   # severity for logger «node.comm»
        file: patak.jpg  # messages will be also printed to patak.jpg

And this configuration corresponds two loggers with LoggerName's node and node.comm.

Synopsis

Documentation

buildAndSetupYamlLogging :: MonadIO m => LoggerConfig -> FilePath -> m () Source #

Applies given builder to parsed logger config and initializes logging.

initLoggingFromYaml :: MonadIO m => FilePath -> m () Source #

Initialize logger hierarchy from configuration file. See this module description.

parseLoggerConfig :: MonadIO m => FilePath -> m LoggerConfig Source #

Parses logger config from given file path.

setupLogging :: MonadIO m => Maybe (UTCTime -> Text) -> LoggerConfig -> m () Source #

This function traverses LoggerConfig initializing all subloggers with Severity and redirecting output in file handlers. See LoggerConfig for more details.