powered by
Append messages to arbitrary TCP destinations.
tcp_appender( host, port, layout = default_log_layout(), timeout = getOption("timeout") )
An appender: a function with the interface function(level, ...)
function(level, ...)
that writes its arguments to the socket and returns invisible(NULL).
invisible(NULL)
Hostname for the socket connection.
Port number for the socket connection.
A layout function taking a level parameter and additional arguments corresponding to the message.
level
Timeout for the connection.
appenders for more information on Appenders, and base::socketConnection() for the underlying connection object used by tcp_appender().
base::socketConnection()
tcp_appender()
if (FALSE) { # Send messages to a listener on localhost. appender <- tcp_appender("localhost", port = 8080) appender("INFO", "Message.") }
Run the code above in your browser using DataLab