open_syslog | R Documentation |
Write messages to the system log via the POSIX syslog interface. Since this
is a thin wrapper around that interface, you may also want to take a look at
its
documentation. Note that neither open_syslog()
nor
close_syslog()
is actually required, but using them is good practice.
open_syslog(
identifier,
open_immediately = FALSE,
include_pid = FALSE,
fallback_to_console = FALSE,
echo = FALSE,
facility = NULL
)
syslog(message, level = "INFO", facility = NULL)
close_syslog()
identifier |
A string identifying the application. |
open_immediately |
When |
include_pid |
When |
fallback_to_console |
Write to the system console (e.g.
|
echo |
Also log the message to standard error. Equivalent to using
|
facility |
The type of program doing the logging, according to the
guidelines in RFC 5424.
Generally one of |
message |
The message to write to the system log. |
level |
The priority level of the message. One of |
## Not run:
open_syslog("my_script")
syslog("Running script.", level = "INFO")
syslog("Possible issue.", level = "WARNING")
close_syslog()
# Opening the syslog is not strictly necessary. You can
# simply write a message and it will open the log with the
# process name (likely "R") as the default.
syslog("Hello from R!", level = "WARNING")
close_syslog()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.