mongoAppender-class | R Documentation |
"mongoAppender"
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
.
All reference classes extend and inherit methods from "envRefClass"
.
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.
logit(line)
:This does the work of logging a line.
logger()
:This returns a function which does the logging.
Russell Almond
flog.appender
MongoDB
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.