Module Logs_syslog_mirage_tls.Tls

TLS reporter

Parameters

module CLOCK : Mirage_clock.PCLOCK
module STACK : Tcpip.Stack.V4V6
module KV : Mirage_kv.RO

Signature

val create : STACK.t -> KV.t -> ?keyname:string -> 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 kv ~keyname ~hostname ip ~port ~truncate ~framing () is Ok reporter or Error msg. Key material (ca-roots.crt, certificate chain, private key) are read from kv (using keyname, defaults to server). The reporter sends log messages to ip, port via TLS. If the initial TLS connection to the remote_ip fails, an Error msg is returned instead. If the TLS connection fails, it is reported via printf, and attempts are made to re-establish the TLS connection. Each message can be truncated (to truncate bytes), default is to not truncate. The hostname is part of each syslog message. The port defaults to 6514, framing to appending a zero byte. facility is the default syslog facility (see Logs_syslog.message).