package logs-syslog
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Logs reporter to syslog (UDP/TCP/TLS)
Install
dune-project
Dependency
Authors
Maintainers
Sources
logs-syslog-0.5.0.tbz
sha256=af1ee692c03ccb5042122b0d4d0c12b0969eb78d9e47bb59de0633bc2aab60d4
sha512=199b34bdc86ce1cad91d9458b67db999cd1cad23c1ea1568ec0349ee3b4cd3bd526ccd5fa51774dd7e3dd0f750938df2e46e08717da3190d37a1e7f5cec701e3
doc/src/logs-syslog/logs_syslog.ml.html
Source file logs_syslog.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53let slevel = function | Logs.App -> Syslog_message.Informational | Logs.Error -> Syslog_message.Error | Logs.Warning -> Syslog_message.Warning | Logs.Info -> Syslog_message.Informational | Logs.Debug -> Syslog_message.Debug let ppf, flush = let b = Buffer.create 255 in let ppf = Format.formatter_of_buffer b in let flush () = Format.pp_print_flush ppf () ; let s = Buffer.contents b in Buffer.clear b ; s in ppf, flush let facility = let ppf ppf v = Format.pp_print_string ppf (Syslog_message.string_of_facility v) in Logs.Tag.def ~doc:"Syslog facility" "syslog-facility" ppf let message ?facility:(syslog_facility = Syslog_message.System_Daemons) ~host:hostname ~source ~ ?header level timestamp message = let = let = Logs.Tag.rem facility tags in if Logs.Tag.is_empty tags then "" else (Logs.Tag.pp_set ppf tags ; " " ^ flush ()) in let hdr = match header with None -> "" | Some x -> " " ^ x in let content = Printf.sprintf "%s%s %s" tags hdr message and severity = slevel level and tag = String.sub source 0 (min 32 (String.length source)) in { Syslog_message.facility = syslog_facility ; severity ; timestamp ; hostname ; tag ; content } type framing = [ | `LineFeed | `Null | `Custom of string | `Count ] let frame_message msg = function | `LineFeed -> msg ^ "\n" | `Null -> msg ^ "\000" | `Custom s -> msg ^ s | `Count -> Printf.sprintf "%d %s" (String.length msg) msg
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>