HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelibsystemd-journal-1.4.5.1GHC2021

Systemd.Journal

  • 9 types
  • 19 values

Writing to the journal

4 declarations
valuesendMessage :: Text -> IO ()
#

Send a message to the systemd journal.

sendMessage t == sendJournalFields (message t)

A structured object of all the fields in an entry in the journal. You generally don't construct this yourself, but you use the monoid instance and smart constructors below.

For example,

sendJournalFields (message "Oh god, it burns!" <> priority Emergency)

Standard systemd journal fields

valuemessage :: Text -> JournalFields
#

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.

valuemessageId :: UUID -> JournalFields
#

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.

datadata Priority
#

Log messages are prioritized with one of the following levels:

Example1 expression
[minBound..maxBound] :: [Priority][Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug]

The Ord instance for Priority considers the more urgent level lower than less urgent ones:

Example3 expressions
Emergency < DebugTrueminimum [minBound..maxBound] :: PriorityEmergencymaximum [minBound..maxBound] :: PriorityDebug

Constructors

Instances8Bounded, Enum, Eq, Ord, Read, Show, …
valueerrno :: Int -> JournalFields
#

The low-level Unix error number causing this entry, if any. Contains the numeric value of errno(3).

Custom journal fields

newtypenewtype JournalField
#
Instances9Eq, Data, Ord, Read, Show, IsString, …

Reading the journal

10 declarations
valueopenJournal
  1. :: MonadSafe m
  2. => [JournalFlag]

    A list of flags taken under logical disjunction (or) to specify which journal files to open.

  3. -> Start

    Where to begin reading journal entries from.

  4. -> Maybe Filter

    An optional filter to apply the journal. Only entries satisfying the filter will be emitted.

  5. -> Maybe Integer

    The data field size threshold, or Nothing for no field size limit

  6. -> Producer' JournalEntry m ()
#

Opens the journal for reading, optionally filtering the journal entries. Filters are defined as arbitrary binary expression trees, which are then rewritten to be in conjunctive normal form before filtering with systemd to comply with systemd's rule system.

datadata Direction
#

In which direction to read the journal.

Constructors

Instances1Eq
  • Eq DirectionDefined in libsystemd-journal-1.4.5.1 · Systemd.Journal
datadata JournalEntry
#

An entry that has been read from the systemd journal.

Instances2Eq, Show

A JournalCursor can be used as marker into the journal stream. This can be used to re-open the journal at a specific point in the future, and JournalCursors can be serialized to disk.

datadata JournalFlag
#

Flags to specify which journal entries to read.

Constructors

  • LocalOnly

    Only journal files generated on the local machine will be opened.

  • RuntimeOnly

    Only volatile journal files will be opened, excluding those which are stored on persistent storage.

  • SystemOnly

    Only journal files of system services and the kernel (in opposition to user session processes) will be opened.

Instances4Bounded, Enum, Eq, Ord
datadata Filter
#

A logical expression to filter journal entries when reading the journal.

Constructors

Instances3Eq, Data, Show
  • Eq FilterDefined in libsystemd-journal-1.4.5.1 · Systemd.Journal
  • Data FilterDefined in libsystemd-journal-1.4.5.1 · Systemd.Journal
  • Show FilterDefined in libsystemd-journal-1.4.5.1 · Systemd.Journal