createLogger | R Documentation |
Creates a new logger
createLogger(logName = "com.default.logger", logFileName = "racas.log",
logDir = racas:::applicationSettings$server.log.path,
logLevel = racas:::applicationSettings$server.log.level,
envir = environment(), logToConsole = FALSE, ...)
logName |
Name for the logger output line within the log file (default: "com.default.logger) |
logFileName |
name of the log file to write to (default: "acas.log") |
logDir |
name directory to write to (default: racas::applicationSettings$server.log.path) |
logLevel |
the level at which to write logs (default: racas::applicationSettings$server.log.level, see names(logging::loglevels)) |
envir |
an environment to attach to the object |
object of class logger
#Creating a logger with logLevel = "WARN"
myLogger <- createLogger(logName = "com.mycompany.newprocessor",
logFileName = "newprocessor.log",
logLevel = "WARN")
#Will write
myLogger$error("a warn statement")
myLogger$warn("a warn statement")
#Won't write items that are below "WARN" in names(logging::loglevels)
myLogger$debug("a debug statement")
myLogger$info("a warn statement")
#Creating a logger with logLevel = "DEBUG"
myLogger <- createLogger(logName = "com.mycompany.newprocessor",
logFileName = "newprocessor.log",
logLevel = "DEBUG")
#Now it will log debug and info statements
myLogger$debug("a debug statement")
myLogger$info("a warn statement")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.