mongoAppender-class: Class '"mongoAppender"'

mongoAppender-classR Documentation

Class "mongoAppender"

Description

This implements the appender protocol logging to a database. Note that flog.appender expects a function as its argument. The $logger() method returns a function which can be passed to flog.appender.

Extends

All reference classes extend and inherit methods from "envRefClass".

Fields

db:

Object of class JSONDB the refernce to the column where the log will be stored.

app:

Object of class character The application identifier for which we are logging errors. (See app()).

engine:

Object of class character giving the name of the processes (in the 4 Process sense) that is generating the messages.

tee:

Object of class character if this has length greater than zero, it should be a file to which the log is also sent. If it is "", then the log message is sent to standard output.

Methods

logit(line):

This does the work of logging a line.

logger():

This returns a function which does the logging.

Author(s)

Russell Almond

See Also

flog.appender MongoDB

Examples

  col <- mongo::MongoDB("ErrorLog","Admin",noMongo=TRUE)
  logfile <- tempfile("testlog","/tmp",fileext=".log")
  apnd <- mongoAppender(db=col,app="p4test",engine="Tester",tee=logfile)
  futile.logger::flog.appender(apnd$logger(),"TEST")

ralmond/Proc4 documentation built on June 13, 2025, 7:13 a.m.