2.0 KiB
name, group, category, update-time, description, key-word
| name | group | category | update-time | description | key-word | ||||
|---|---|---|---|---|---|---|---|---|---|
| configured-logger-file-rotation-failures | api | runtime | 20260512 | Read the number of rotation failures recorded by the configured runtime file sink. |
|
Configured-logger-file-rotation-failures
Read the number of rotation failures recorded by a ConfiguredLogger file sink. This helper is useful when runtime rotation behavior should be observed operationally.
Interface
pub fn ConfiguredLogger::file_rotation_failures(self : ConfiguredLogger) -> Int {}
input
self : ConfiguredLogger- Config-driven runtime logger whose rotation-failure counter should be inspected.
output
Int- Number of recorded rotation failures.
Explanation
Detailed rules explaining key parameters and behaviors
- File-backed sinks report their recorded rotation-failure count.
- Queued file sinks forward the metric from the wrapped file sink.
- Non-file sinks return
0. - The counter is cumulative until reset.
How to Use
Here are some specific examples provided.
When Need Rotation-specific Diagnostics
When support output should reveal whether rotation is failing:
let count = logger.file_rotation_failures()
In this example, the configured logger exposes a focused metric for rotation-path health.
When Validate Runtime Rotation Tuning
When changed rotation settings should be checked in operation:
ignore(logger.file_rotation_failures())
In this example, callers can observe whether runtime rotation changes introduced problems.
Error Case
e.g.:
-
If the configured sink is not file-backed, the method returns
0. -
If callers need both rotation config and failure metrics, they should combine this helper with
file_rotation_config()orfile_state().
Notes
-
Use this helper when diagnosing file rotation reliability.
-
It is especially relevant when runtime rotation policy can change after startup.