redis_logger: Logging to Redis Database

Description Usage Arguments Value Functions Layout See Also

View source: R/logger.R

Description

The functions define logging environment for writing log messages to the Redis data base using futile.logger's logging facilities

Usage

1
2
3
4
5
6
layout.redis(ApplicationId, ApplicationInstanceId)

appender.redis(channel, logToConsole = FALSE)

redis_logger(ApplicationId, ApplicationInstanceId,
  channel = redis_options("logChannel"), logToConsole = FALSE)

Arguments

ApplicationId

string, unique ID of the logging application

ApplicationInstanceId

string, unique ID of the single instance of the logging application

channel

Redis channel to publish logging messages

logToConsole

logical, if TRUE logging message is written to console too

Value

layout.redis returns a function with arguments level, msg, and additional arguments ..., see Layout section and flog.layout for details.

appender.redis returns a function with one argument line that publishes the logging message to the Redis channel channel and optionally writes it to the console (stdout()).

Functions

Layout

The logging message is a JSON string with two elements at the base level

Metadata

contains ApplicationId and ApplicationInstanceId

LoggingDocument

contains a list of message specific elements

Both meta data ApplicationId and ApplicationInstanceId must be supplied. If missing the respective redis options will be used.

The level argument in the returned function will control the layout of the LoggingDocument list. Additional arguments ... either set list elements of LoggingDocument directly (if present) or will be coerced to a "details" JSON-string.

See Also

flog.layout for managing layouts in futile.logger package

flog.appender for managing logging appenders in futile.logger package

flog.logger for managing loggers in futile.logger package


mlkornexl/easyRedis documentation built on May 17, 2019, 9:13 a.m.