Copyright | (c) Serokell 2016 |
---|---|
License | GPL-3 (see the file LICENSE) |
Maintainer | Serokell <hi@serokell.io> |
Stability | experimental |
Portability | POSIX, GHC |
Safe Haskell | None |
Language | Haskell2010 |
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
.
- buildAndSetupYamlLogging :: MonadIO m => LoggerConfig -> FilePath -> m ()
- initLoggingFromYaml :: MonadIO m => FilePath -> m ()
- parseLoggerConfig :: MonadIO m => FilePath -> m LoggerConfig
- setupLogging :: MonadIO m => LoggerConfig -> m ()
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 => LoggerConfig -> m () Source #
This function traverses LoggerConfig
initializing all subloggers
with Severity
and redirecting output in file handlers.
See LoggerConfig
for more details.