Struct JournalLog

Source
pub struct JournalLog { /* private fields */ }

Implementations§

Source§

impl JournalLog

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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=.

Source

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.

Source

pub fn tid(&self) -> &Option<String>

The numeric thread ID (TID) the log message originates from.

Source

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.

Source

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.

Source

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).

Source

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).

Source

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).

Source

pub fn comm(&self) -> &Option<String>

The name, the executable path, and the command line of the process the journal entry originates from.

Source

pub fn exe(&self) -> &Option<String>

The name, the executable path, and the command line of the process the journal entry originates from.

Source

pub fn cmdline(&self) -> &Option<String>

The name, the executable path, and the command line of the process the journal entry originates from.

Source

pub fn cap_effective(&self) -> &Option<String>

Source

pub fn audit_session(&self) -> &Option<String>

Source

pub fn audit_loginuid(&self) -> &Option<String>

Source

pub fn systemd_cgroup(&self) -> &Option<String>

Source

pub fn systemd_slice(&self) -> &Option<String>

Source

pub fn systemd_unit(&self) -> &Option<String>

Source

pub fn systemd_user_unit(&self) -> &Option<String>

Source

pub fn systemd_user_slice(&self) -> &Option<String>

Source

pub fn systemd_session(&self) -> &Option<String>

Source

pub fn systemd_owner_uid(&self) -> &Option<String>

Source

pub fn selinux_context(&self) -> &Option<String>

Source

pub fn source_realtime_timestamp(&self) -> &Option<String>

Source

pub fn boot_id(&self) -> &Option<String>

Source

pub fn machine_id(&self) -> &Option<String>

Source

pub fn systemd_invocation_id(&self) -> &Option<String>

Source

pub fn hostname(&self) -> &Option<String>

Source

pub fn transport(&self) -> &Transport

Source

pub fn stream_id(&self) -> &Option<String>

Source

pub fn line_break(&self) -> &Option<String>

Source

pub fn namespace(&self) -> &Option<String>

Source

pub fn runtime_scope(&self) -> &Option<String>

Trait Implementations§

Source§

impl Debug for JournalLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for JournalLog

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for JournalLog

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,