pub struct JournalLog { /* private fields */ }
Implementations§
Source§impl JournalLog
impl JournalLog
Sourcepub fn message(&self) -> &String
pub fn message(&self) -> &String
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 metadata. In order to encode multiple lines in a single log entry, separate them by newline characters (ASCII code 10), but encode them as a single MESSAGE= field. Do not add multiple values of this field type to the same entry (also see above), as consuming applications generally do not expect this and are unlikely to show all values in that case.
Sourcepub fn message_id(&self) -> &Option<String>
pub fn message_id(&self) -> &Option<String>
A 128-bit message identifier ID for recognizing certain message types, if this is desirable. This should contain a 128-bit ID formatted as a lower-case hexadecimal string, without any separating dashes or suchlike. This is recommended to be a UUID-compatible ID, but this is not enforced, and formatted differently. Developers can generate a new ID for this purpose with systemd-id128 new.
Sourcepub fn priority(&self) -> &Option<Priority>
pub fn priority(&self) -> &Option<Priority>
A priority value between 0 (“emerg”) and 7 (“debug”) formatted as a decimal string. This field is compatible with syslog’s priority concept.
Sourcepub fn code_file(&self) -> &Option<String>
pub fn code_file(&self) -> &Option<String>
The code location generating this message, if known. Contains the source filename, the line number and the function name.
Sourcepub fn code_line(&self) -> &Option<String>
pub fn code_line(&self) -> &Option<String>
The code location generating this message, if known. Contains the source filename, the line number and the function name.
Sourcepub fn code_func(&self) -> &Option<String>
pub fn code_func(&self) -> &Option<String>
The code location generating this message, if known. Contains the source filename, the line number and the function name.
Sourcepub fn errno(&self) -> &Option<String>
pub fn errno(&self) -> &Option<String>
The low-level Unix error number causing this entry, if any. Contains the numeric value of errno(3) formatted as a decimal string.
Sourcepub fn invocation_id(&self) -> &Option<String>
pub fn invocation_id(&self) -> &Option<String>
A randomized, unique 128-bit ID identifying each runtime cycle of the unit. This is different from _SYSTEMD_INVOCATION_ID in that it is only used for messages coming from systemd code (e.g. logs from the system/user manager or from forked processes performing systemd-related setup).
Sourcepub fn user_invocation_id(&self) -> &Option<String>
pub fn user_invocation_id(&self) -> &Option<String>
A randomized, unique 128-bit ID identifying each runtime cycle of the unit. This is different from _SYSTEMD_INVOCATION_ID in that it is only used for messages coming from systemd code (e.g. logs from the system/user manager or from forked processes performing systemd-related setup).
Sourcepub fn syslog_facility(&self) -> &Option<String>
pub fn syslog_facility(&self) -> &Option<String>
Syslog compatibility fields containing the facility (formatted as decimal string), the identifier string (i.e. “tag”), the client PID, and the timestamp as specified in the original datagram. (Note that the tag is usually derived from glibc’s program_invocation_short_name variable, see program_invocation_short_name(3).)
Note that the journal service does not validate the values of any structured journal fields whose name is not prefixed with an underscore, and this includes any syslog related fields such as these. Hence, applications that supply a facility, PID, or log level are expected to do so properly formatted, i.e. as numeric integers formatted as decimal strings.
Sourcepub fn syslog_identifier(&self) -> &Option<String>
pub fn syslog_identifier(&self) -> &Option<String>
Syslog compatibility fields containing the facility (formatted as decimal string), the identifier string (i.e. “tag”), the client PID, and the timestamp as specified in the original datagram. (Note that the tag is usually derived from glibc’s program_invocation_short_name variable, see program_invocation_short_name(3).)
Note that the journal service does not validate the values of any structured journal fields whose name is not prefixed with an underscore, and this includes any syslog related fields such as these. Hence, applications that supply a facility, PID, or log level are expected to do so properly formatted, i.e. as numeric integers formatted as decimal strings.
Sourcepub fn syslog_pid(&self) -> &Option<String>
pub fn syslog_pid(&self) -> &Option<String>
Syslog compatibility fields containing the facility (formatted as decimal string), the identifier string (i.e. “tag”), the client PID, and the timestamp as specified in the original datagram. (Note that the tag is usually derived from glibc’s program_invocation_short_name variable, see program_invocation_short_name(3).)
Note that the journal service does not validate the values of any structured journal fields whose name is not prefixed with an underscore, and this includes any syslog related fields such as these. Hence, applications that supply a facility, PID, or log level are expected to do so properly formatted, i.e. as numeric integers formatted as decimal strings.
Sourcepub fn syslog_timestamp(&self) -> &Option<String>
pub fn syslog_timestamp(&self) -> &Option<String>
Syslog compatibility fields containing the facility (formatted as decimal string), the identifier string (i.e. “tag”), the client PID, and the timestamp as specified in the original datagram. (Note that the tag is usually derived from glibc’s program_invocation_short_name variable, see program_invocation_short_name(3).)
Note that the journal service does not validate the values of any structured journal fields whose name is not prefixed with an underscore, and this includes any syslog related fields such as these. Hence, applications that supply a facility, PID, or log level are expected to do so properly formatted, i.e. as numeric integers formatted as decimal strings.
Sourcepub fn syslog_raw(&self) -> &Option<String>
pub fn syslog_raw(&self) -> &Option<String>
The original contents of the syslog line as received in the syslog datagram. This field is only included if the MESSAGE= field was modified compared to the original payload or the timestamp could not be located properly and is not included in SYSLOG_TIMESTAMP=. Message truncation occurs when the message contains leading or trailing whitespace (trailing and leading whitespace is stripped), or it contains an embedded NUL byte (the NUL byte and anything after it is not included). Thus, the original syslog line is either stored as SYSLOG_RAW= or it can be recreated based on the stored priority and facility, timestamp, identifier, and the message payload in MESSAGE=.
Sourcepub fn documentation(&self) -> &Option<String>
pub fn documentation(&self) -> &Option<String>
A documentation URL with further information about the topic of the log message. Tools such as journalctl will include a hyperlink to a URL specified this way in their output. Should be an “http:///”, “https:///”, “file:/”, “man:” or “info:” URL.
Sourcepub fn tid(&self) -> &Option<String>
pub fn tid(&self) -> &Option<String>
The numeric thread ID (TID) the log message originates from.
Sourcepub fn unit(&self) -> &Option<String>
pub fn unit(&self) -> &Option<String>
The name of a unit. Used by the system and user managers when logging about specific units.
When –unit=name or –user-unit=name are used with journalctl(1), a match pattern that includes “UNIT=name.service” or “USER_UNIT=name.service” will be generated.
Sourcepub fn user_unit(&self) -> &Option<String>
pub fn user_unit(&self) -> &Option<String>
The name of a unit. Used by the system and user managers when logging about specific units.
When –unit=name or –user-unit=name are used with journalctl(1), a match pattern that includes “UNIT=name.service” or “USER_UNIT=name.service” will be generated.
Sourcepub fn pid(&self) -> &Option<String>
pub fn pid(&self) -> &Option<String>
The process, user, and group ID of the process the journal entry originates from formatted as a decimal string. Note that entries obtained via “stdout” or “stderr” of forked processes will contain credentials valid for a parent process (that initiated the connection to systemd-journald).
Sourcepub fn uid(&self) -> &Option<String>
pub fn uid(&self) -> &Option<String>
The process, user, and group ID of the process the journal entry originates from formatted as a decimal string. Note that entries obtained via “stdout” or “stderr” of forked processes will contain credentials valid for a parent process (that initiated the connection to systemd-journald).
Sourcepub fn gid(&self) -> &Option<String>
pub fn gid(&self) -> &Option<String>
The process, user, and group ID of the process the journal entry originates from formatted as a decimal string. Note that entries obtained via “stdout” or “stderr” of forked processes will contain credentials valid for a parent process (that initiated the connection to systemd-journald).
Sourcepub fn comm(&self) -> &Option<String>
pub fn comm(&self) -> &Option<String>
The name, the executable path, and the command line of the process the journal entry originates from.
Sourcepub fn exe(&self) -> &Option<String>
pub fn exe(&self) -> &Option<String>
The name, the executable path, and the command line of the process the journal entry originates from.
Sourcepub fn cmdline(&self) -> &Option<String>
pub fn cmdline(&self) -> &Option<String>
The name, the executable path, and the command line of the process the journal entry originates from.