#[non_exhaustive]pub struct FileLoggingConfig {
pub enabled: bool,
pub file_path: String,
pub rotation: RotationConfig,
}Expand description
Configuration for file-based logging.
§Note
File logging is primarily intended for development and debugging. In production, ensure logs do not contain PII or sensitive data.
§Error Behavior
If file logging is enabled and cannot be initialized (e.g., invalid path, permission denied, unwritable directory), the application will panic with a clear error message. This fail-fast behavior ensures that logging issues are detected immediately rather than silently losing logs.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolWhether file logging is enabled.
Defaults to false - requires explicit opt-in.
file_path: StringFull path to the log file (e.g., /var/log/myapp/service.log).
Note: With rolling::daily or rolling::hourly, the actual log files
will have date suffixes (e.g., service.2026-01-17), not the exact
path specified here. This path is used to derive the directory and
filename prefix.
rotation: RotationConfigLog rotation settings.
Implementations§
Source§impl FileLoggingConfig
impl FileLoggingConfig
Sourcepub fn builder() -> FileLoggingConfigBuilder
pub fn builder() -> FileLoggingConfigBuilder
Returns a builder for constructing a FileLoggingConfig.
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Applies environment variable overrides to the configuration.
Environment variables take precedence over values in the config struct.
Supported environment variables:
SIGNAL_KIT_FILE_ENABLED: “true”, “false”, “1”, or “0”SIGNAL_KIT_FILE_PATH: Full path to the log fileSIGNAL_KIT_FILE_ROTATION: “daily”, “hourly”, or “never”SIGNAL_KIT_FILE_RETENTION_DAYS: Number of days (u32)
Trait Implementations§
Source§impl Clone for FileLoggingConfig
impl Clone for FileLoggingConfig
Source§impl Debug for FileLoggingConfig
impl Debug for FileLoggingConfig
Source§impl Default for FileLoggingConfig
impl Default for FileLoggingConfig
Source§impl<'de> Deserialize<'de> for FileLoggingConfig
impl<'de> Deserialize<'de> for FileLoggingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for FileLoggingConfig
impl Freeze for FileLoggingConfig
impl Move for FileLoggingConfig
impl RefUnwindSafe for FileLoggingConfig
impl Send for FileLoggingConfigwhere
RawVecInner: Send,
impl Sync for FileLoggingConfigwhere
RawVecInner: Sync,
impl Unpin for FileLoggingConfig
impl UnsafeUnpin for FileLoggingConfig
impl UnwindSafe for FileLoggingConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request