atoti.config.logging module¶
- class atoti.config.logging.LoggingConfig(destination=None, file_path=None)¶
The configuration describing how the session logs will be handled.
Example
>>> config = {"logging": {"destination": "./atoti/server.log"}}
- destination: Optional[Union[pathlib.Path, str, io.TextIOBase]] = None¶
The place where the session logs will be written to.
If
None
, the logs will be written tologs/server.log
in the session directory under$ATOTI_HOME
(this environment variable itself defaults to$HOME/.atoti
).Note
Unless an instance of
io.TextIOBase
is passed, the rolling policy is:Maximum file size of 10MB.
Maximum history of 7 days.
Once the maximum size is reached, logs are archived following the pattern
f"{destination}.{date}.{i}.gz"
wheredate
is the creation date of the file in theyyyy-MM-dd
format andi
an integer incremented during the day.Example
To stream the session logs to the Python process’ standard output:
>>> import sys >>> config = {"logging": {"destination": sys.stdout}}
- file_path: Optional[Union[str, pathlib.Path]] = None¶
The path of the file where the session logs will be written to.
Warning
This configuration option is deprecated. Use
destination
instead.