Module Logs_syslog_mirage.Tcp

TCP syslog

Parameters

module CLOCK : Mirage_clock.PCLOCK
module STACK : Tcpip.Stack.V4V6

Signature

val create : STACK.t -> hostname:string -> STACK.IP.ipaddr -> ?port:int -> ?truncate:int -> ?framing:Logs_syslog.framing -> ?facility:Syslog_message.facility -> unit -> (Logs.reporter, string) Stdlib.result Lwt.t

create tcp ~hostname ip ~port ~truncate ~framing () is Ok reporter or Error msg. The reporter sends log messages to ip, port via TCP. If the initial TCP connection to the remote_ip fails, an Error msg is returned instead. If the TCP connection fails, an error is logged via printf, and attempts are made to re-establish the TCP connection. Each syslog message can be truncated, depending on truncate (defaults to no truncating). The hostname is part of each syslog message. The default value of port is 514, the default behaviour of framing is to append a zero byte. facility is the default syslog facility (see Logs_syslog.message).