Module Simantics/AuditLogging/Server
This module is undocumented. This is a list of its definitions.
allLogEvents :: String -> Integer -> <Proc,Exception> Map.T String [String]
allLogEvents level days collects getLogEventsDays for every registered
service into a map keyed by the service key. A service whose events cannot be
read is logged and left out of the result.
error :: String -> Map.T String a -> <Proc,Exception> ()
As log, but writes to the error level log.
getLogEvents :: String -> String -> String -> String -> <Proc,Exception> [String]
getLogEvents key level startDate endDate is as getLogEventsDays but takes
an explicit date range, both ends included, with the dates written in ISO
form as in "2026-08-19".
getLogEventsDays :: String -> String -> Integer -> <Proc,Exception> [String]
getLogEventsDays key level days returns the JSON lines logged for the
registered service at the given level over the last days days up to and
including today. The level is "INFO", "ERROR" or "TRACE", in any
letter case. Days with no log file are skipped rather than failing.
log :: String -> Map.T String a -> <Proc,Exception> ()
log key event appends the event to today's info level log of the registered
service as one line of JSON. The event map is stored under original inside
a wrapper that also records the timestamp, the key and the level, so the keys
of the event cannot collide with those.
register :: String -> <Proc> String
Registers a service under the given identifier and returns the key its log
entries are stored under, which is the identifier with a fresh UUID appended.
A directory of that name is created in the audit log location. Every other
function here takes this key.
start :: String -> Integer -> <Proc> ()
start token port starts the audit logging REST service on the given port,
in a background thread. Calling it again while the service runs does not
start a second one, and the port of the first call is the one in use. The
token is currently not checked.
trace :: String -> Map.T String a -> <Proc,Exception> ()
As log, but writes to the trace level log.
|