Enum logcontrol::KnownLogTarget
source · pub enum KnownLogTarget {
Console,
Kmsg,
Journal,
Syslog,
Null,
Auto,
}
Expand description
Known log targets documented in the log control interface or systemctl(1)
.
Note that systemctl
does not validate the log target; systemctl service-log-target
passes any given string to the service.
This enum represents all log targets documented at various places, and their semantics.
Implementations of LogControl1
can use this enum to parse known targets,
or entirely ignore it and handle the target themselves; the latter allows
services to implement their own proprietary log targets.
Variants§
Console
Log to the console or standard output.
Kmsg
The kernel ring message buffer.
Normally not used by userspace services.
Journal
Log to the journal natively.
Prefer this other log targets when running under systemd, because this log target retains all structured data.
See stderr_connected_to_journal
to determine whether the current
process is already connected to the journal (i.e. its stderr goes
directly into the systemd journal).
Syslog
The legacy syslog interface.
Services which use systemd should prefer the Journal
interface.
Null
Disable all logging.
Note that even though this target is not documented in the logcontrol
interface definition, the systemctl(1)
manpage mentions it for the
service-log-target
command.
Auto
Automatically log to console or journal.
If the stdout or stderr streams of the current process are
connected to the systemd journal this is equivalent to Journal
.
Otherwise it’s Console
.
See stderr_connected_to_journal
for a function which implements this
check.
Note that even though this target is not documented in the logcontrol
interface definition, the systemctl(1)
manpage mentions it for the
service-log-target
command.
Implementations§
Trait Implementations§
source§impl Clone for KnownLogTarget
impl Clone for KnownLogTarget
source§fn clone(&self) -> KnownLogTarget
fn clone(&self) -> KnownLogTarget
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for KnownLogTarget
impl Debug for KnownLogTarget
source§impl Display for KnownLogTarget
impl Display for KnownLogTarget
source§impl PartialEq for KnownLogTarget
impl PartialEq for KnownLogTarget
source§fn eq(&self, other: &KnownLogTarget) -> bool
fn eq(&self, other: &KnownLogTarget) -> bool
self
and other
values to be equal, and is used
by ==
.