From a2706282de0f68bc02839a5b18be971aaff4a897 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Wed, 28 Feb 2024 22:00:23 +0100 Subject: [PATCH] Document parameters --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e3d9b0..dc4fbd2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,19 @@ TimedSwitchingFileHandler ------------------------- This file handler starts a new file at regular intervals, comparable to -the TimedRotatingFileHandler. +the TimedRotatingFileHandler. The switch always occurs at a “round” +time, i.e. at the hour for hourly switches, at midnight for daily +switches, etc. The old file stays open until just before the first log +entry is written to the new file. + +### Parameters + +| Parameter | Default | Description | +|-|-|-| +| `filename` | (required) | Path to the log files. The timestamp and `.log` is appended | +| `when` | `'h'` | When log files are switched: (every **s**econd, **m**inute, **h**our, **d**ay, **w**eek) | +| `utc` | `False` | Timestamps are in UTC (otherwise local time) | +| `create_directory` | `False` | Intermediate directories in `filename` are created if necessary | TimeoutSwitchingFileHandler --------------------------- @@ -25,3 +37,12 @@ activity alternate with periods of inactivity. Log switchse will typically occur during inactivity, so each log file will include one complete active period. Also, since the log files are closed, they can be safely compressed or removed. + +### Parameters + +| Parameter | Default | Description | +|-|-|-| +| `filename` | (required) | Path to the log files. The timestamp is appended | +| `min_timeout` | `60` | Logfile is closed if there hasn't been any activity for `min_timeout` seconds | +| `max_timeout` | `3600` | Logfile is closed if is has been created `max_timeout` seconds ago | +| `create_directory` | `False` | Intermediate directories in `filename` are created if necessary |