Safe Haskell | None |
---|
- logMessage :: Text -> IO ()
- logMessageWith :: Text -> LogProperties -> IO ()
- logProperties :: LogProperties -> IO ()
- type LogProperties = HashMap LogKey Text
- message :: Text -> LogProperties
- messageId :: UUID -> LogProperties
- priority :: Priority -> LogProperties
- data Priority
- codeFile :: FilePath -> LogProperties
- codeLine :: Int -> LogProperties
- codeFunc :: Text -> LogProperties
- errno :: Int -> LogProperties
- syslogFacility :: Facility -> LogProperties
- syslogIdentifier :: Text -> LogProperties
- syslogPid :: CPid -> LogProperties
- data LogKey
- mkLogKey :: Text -> LogKey
Logging
logMessage :: Text -> IO ()
Log a message to the systemd journal.
logMessageWith :: Text -> LogProperties -> IO ()
Log a message and supply extra metadata. All metadata keys will be converted to uppercase for you.
Note: The Message
meta-data property will be replaced with the first
parameter to this function. If you don't want this, use logMap
logProperties :: LogProperties -> IO ()
Log Properties
type LogProperties = HashMap LogKey Text
A structured object of properties to log. You generally don't construct this yourself, but you use the monoid instance and smart constructors below. For example,
logProperties (message "Oh god, it burns!" <> priority Emergency)
Standard systemd log properties
message :: Text -> LogProperties
The human readable message string for this entry. This is supposed to be the primary text shown to the user. It is usually not translated (but might be in some cases), and is not supposed to be parsed for meta data.
messageId :: UUID -> LogProperties
A 128bit message identifier ID for recognizing certain message types, if
this is desirable. Developers can generate a new ID for this purpose with
journalctl --new-id
.
priority :: Priority -> LogProperties
A priority value compatible with syslog's priority concept.
data Priority
Log messages are prioritized.
codeFile :: FilePath -> LogProperties
The source code file generating this message.
codeLine :: Int -> LogProperties
The source code line number generating this message.
codeFunc :: Text -> LogProperties
The source code function name generating this message.
errno :: Int -> LogProperties
The low-level Unix error number causing this entry, if any. Contains the
numeric value of errno(3)
.
syslogFacility :: Facility -> LogProperties
Syslog compatibility field.
syslogIdentifier :: Text -> LogProperties
Syslog compatibility field.
syslogPid :: CPid -> LogProperties
Syslog compatibility field.
Custom Properties
data LogKey