Configured-logger-file-flush-failures
Read the number of flush failures recorded by a ConfiguredLogger file sink. This helper is useful for diagnosing durability-path problems on file-backed loggers.
Interface
pub fn ConfiguredLogger::file_flush_failures(self : ConfiguredLogger) -> Int {}input
self : ConfiguredLogger- Config-driven runtime logger whose flush-failure counter should be inspected.
output
Int- Number of recorded flush failures.
Explanation
Detailed rules explaining key parameters and behaviors
- File-backed sinks report their recorded flush-failure count through the wrapped
RuntimeSink. - Queued file sinks forward the metric from the wrapped inner file sink.
- Non-file sinks return
0. - The counter is cumulative until reset.
How to Use
Here are some specific examples provided.
When Need Durability-path Diagnostics
When support output should show flush-path instability:
let count = logger.file_flush_failures()In this example, the configured logger exposes whether flush attempts have been failing.
When Inspect Effects Of Auto-flush Policy
When runtime durability tuning should be inspected operationally:
ignore(logger.file_flush_failures())In this example, callers can correlate flush failures with runtime file policy choices.
Error Case
e.g.:
If the configured sink is not file-backed, the method returns
0.If callers need current policy and counters together,
file_state()is the better API.
Notes
Use this helper when flush-path reliability matters.
Pair it with
file_auto_flush()andfile_flush()when diagnosing durability behavior.