pub struct SettingsLogs {
pub archive_hook: SettingsLogsArchiveHook,
pub line_retention: i64,
pub log_format: String,
pub time_retention: String,
pub timestamp: bool,
pub timestamp_format: String,
}Expand description
The logs.* settings.
Fields§
§archive_hook: SettingsLogsArchiveHook§line_retention: i64Count-based log retention (e.g. 10000)
Maximum number of log entries to keep per daemon in the SQLite log store.
When set, only the most recent N log entries are retained. Older entries are automatically pruned.
When set to 0 (default), no count-based pruning is performed. You can combine
this with time_retention to enforce both a time limit and a line count limit.
Logs are pruned automatically by the supervisor during its interval watcher cycle (no more than once per hour). No manual rotation command is needed.
log_format: StringDefault log format for daemons (json | logfmt | text)
time_retention: StringTime-based log retention duration (e.g. ‘7d’, ‘30d’)
Maximum age of log entries to keep in the SQLite log store.
When set, log entries older than this duration are automatically pruned.
Examples: "7d" for 7 days, "30d" for 30 days, "1h" for 1 hour.
When empty (default), no time-based pruning is performed. You can combine
this with line_retention to enforce both a time limit and a line count limit.
Logs are pruned automatically by the supervisor during its interval watcher cycle (no more than once per hour). No manual rotation command is needed.
timestamp: boolShow timestamps in log output
When enabled (default), pitchfork prefixes each log line with a timestamp
(e.g. 07-10 10:30:00).
When disabled, timestamps are omitted from pitchfork logs output. This is
useful when piping logs to tools like lnav that expect raw JSON or when
you want to process log output without the timestamp prefix.
Can be overridden per-invocation with pitchfork logs --no-timestamp.
timestamp_format: Stringstrftime format for log timestamps in pitchfork logs output
Controls the date/time format used when displaying timestamps in pitchfork logs
output. Uses chrono strftime syntax.
Common format specifiers:
%Y— full year (2024)%m— month (01-12)%d— day (01-31)%H— hour (00-23)%M— minute (00-59)%S— second (00-59)
Examples:
%m-%d %H:%M:%S—07-10 10:30:00(default)%Y-%m-%d %H:%M:%S—2024-07-10 10:30:00%H:%M:%S—10:30:00(time only)%Y/%m/%d %H:%M—2024/07/10 10:30
Only affects the text display output, not --json or --raw modes.
Implementations§
Source§impl SettingsLogs
impl SettingsLogs
Sourcepub const SETTINGS_PROPS: &'static [PropMeta] = <Self as ::usage_config::Props>::PROPS
pub const SETTINGS_PROPS: &'static [PropMeta] = <Self as ::usage_config::Props>::PROPS
Every setting this struct declares, one entry per field, flattened groups
included. The registry a build.rs used to generate, generated from the
struct instead — there is no second declaration to keep in step.
Sourcepub const SETTINGS_REGISTRY: Registry
pub const SETTINGS_REGISTRY: Registry
The registry over Self::SETTINGS_PROPS, for resolve, drift, and
the layers.
Sourcepub const SETTINGS_SPEC: ConfigSpec
pub const SETTINGS_SPEC: ConfigSpec
Metadata used only when lowering this declaration into a usage spec.
Sourcepub fn read(__usage_resolved: &Resolved) -> Result<Self, ReadErrors>
pub fn read(__usage_resolved: &Resolved) -> Result<Self, ReadErrors>
This resolution’s values, as the struct.
Every field is read before anything is returned, so the error is the whole list of what is wrong rather than the first thing found.
Sourcepub fn read_lossy(__usage_resolved: &Resolved) -> (Option<Self>, ReadErrors)
pub fn read_lossy(__usage_resolved: &Resolved) -> (Option<Self>, ReadErrors)
This resolution’s values, keeping every setting that reads.
Self::read is all or nothing, which leaves a CLI two moves when one
field is bad: refuse to start, or fall back to a struct of declared
defaults and lose the environment and every config file along with the
offending value. Neither is a choice this crate should be making.
So: a field that will not read falls back to its own declared default and
the rest keep what the merge gave them, with every failure returned
alongside for the CLI to raise, log, or ignore as it sees fit. The errors
are the same ::usage_config::ReadErrors Self::read returns, so a
caller that decides a bad value is fatal has lost nothing by asking.
None only where a setting has no value and no declared default — a hole
in the declaration rather than a bad value, and nothing to fall back to.
Trait Implementations§
Source§impl Clone for SettingsLogs
impl Clone for SettingsLogs
Source§fn clone(&self) -> SettingsLogs
fn clone(&self) -> SettingsLogs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SettingsLogs
impl Debug for SettingsLogs
Source§impl PartialEq for SettingsLogs
impl PartialEq for SettingsLogs
Source§impl Props for SettingsLogs
impl Props for SettingsLogs
Source§const PROP_SPECS: &'static [PropSpec]
const PROP_SPECS: &'static [PropSpec]
Props::PROPS.impl StructuralPartialEq for SettingsLogs
Auto Trait Implementations§
impl Freeze for SettingsLogs
impl RefUnwindSafe for SettingsLogs
impl Send for SettingsLogs
impl Sync for SettingsLogs
impl Unpin for SettingsLogs
impl UnsafeUnpin for SettingsLogs
impl UnwindSafe for SettingsLogs
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more