THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class AdvancedRotatingFileHandler(Handler): (source)
Constructor: AdvancedRotatingFileHandler(path_template, suffix_resolver, max_bytes, backup_count, ...)
Undocumented
| Method | __init__ |
Initialize the advanced rotating file handler. |
| Method | _cleanup |
Remove old log files exceeding the backup count. |
| Method | _compress |
Compress the specified file using gzip. |
| Method | _ensure |
Ensure the stream is available and up to date. |
| Method | _resolve |
Resolve the full path by replacing the {suffix} placeholder. |
| Method | _rotate |
Rotate the current log file if needed. |
| Method | _should |
Determine whether the log file should be rotated. |
| Method | close |
Close the handler and release resources. |
| Method | emit |
Emit a log record. |
| Instance Variable | _cache |
Undocumented |
| Instance Variable | _cleanup |
Undocumented |
| Instance Variable | _lock |
Undocumented |
| Instance Variable | _path |
Undocumented |
| Instance Variable | app |
Undocumented |
| Instance Variable | backup |
Undocumented |
| Instance Variable | compress |
Undocumented |
| Instance Variable | current |
Undocumented |
| Instance Variable | current |
Undocumented |
| Instance Variable | delay |
Undocumented |
| Instance Variable | encoding |
Undocumented |
| Instance Variable | file |
Undocumented |
| Instance Variable | max |
Undocumented |
| Instance Variable | path |
Undocumented |
| Instance Variable | stream |
Undocumented |
| Instance Variable | suffix |
Undocumented |
str, suffix_resolver: SuffixResolver, max_bytes: int | None = None, backup_count: int = 5, encoding: str = 'utf-8', *, delay: bool = True, compress_rotated: bool = False, app_root: str = '.'):
(source)
¶
Initialize the advanced rotating file handler.
| Parameters | |
pathstr | Path template containing the {suffix} placeholder. |
suffixSuffixResolver | Resolver for determining the suffix for rotation. |
maxint | None, optional | Maximum file size in bytes before rotation (for chunked rotation). |
backupint, optional | Maximum number of backup files to retain. |
encoding:str, optional | File encoding. |
delay:bool, optional | If True, delay file opening until the first log record. |
compressbool, optional | If True, compress rotated files using gzip. |
appstr, optional | Application root directory. |
| Returns | |
None | This method does not return a value. |
Remove old log files exceeding the backup count.
This method deletes log files that exceed the configured backup count, including compressed versions if present.
| Returns | |
None | This method does not return a value. |
Ensure the stream is available and up to date.
Checks if log rotation is needed and opens a new stream if required. Updates the current suffix and file size accordingly.
| Returns | |
None | This method does not return a value. |
Rotate the current log file if needed.
This method closes the current stream, compresses the rotated file if enabled, cleans up old log files, and resets the handler's state.
| Returns | |
None | This method does not return a value. |
Close the handler and release resources.
Closes the underlying stream if open and releases any resources held by the handler. Ensures thread safety during the close operation.
| Returns | |
None | This method does not return a value. |