addDefaultEmailLogger | R Documentation |
Add the default e-mail logger
addDefaultEmailLogger(
mailSettings,
label = Sys.info()["nodename"],
name = "DEFAULT_EMAIL_LOGGER",
test = FALSE
)
mailSettings |
Arguments to be passed to the |
label |
A label to be used in the e-mail subject to identify a run. By default the name of the computer is used. |
name |
A name for the logger. |
test |
If TRUE, a message will be displayed on the console instead of sending an e-mail. |
Creates a logger that writes to e-mail using the "FATAL" threshold and the
layoutEmail
layout. This function uses the sendmailR
package. Please make sure
your e-mail settings are correct by using the sendmailR
package before using those settings here.
ParallelLogger
will not display any messages if something goes wrong when sending the e-mail.
To use a GMail account, make sure to enable 2-step verification on your
Google account (see 'Security'). Click on 2-Step Verification, and
scroll down to 'App passwords'. Here, you can create an app-specific password
to be used with ParallelLogger
. You can set
host.name = "smtp.gmail.com:587"
, and be sure to use
engine = "curl"
.
mailSettings <- list(
from = "someone@gmail.com",
to = "someone_else@gmail.com",
engine = "curl",
engineopts = list(
username = "someone@gmail.com",
password = "Secret!"
),
control = list(
host.name = "smtp.gmail.com:587"
)
)
# Setting test to TRUE in this example so we don't really send an e-mail:
addDefaultEmailLogger(mailSettings, "My R session", test = TRUE)
logFatal("Something bad")
unregisterLogger("DEFAULT_EMAIL_LOGGER")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.