Skip to content

bulk_rotating_file_handler

messageflux.logging.bulk_rotating_file_handler

BulkRotatingFileHandler

BulkRotatingFileHandler(
    live_log_path,
    rotated_log_path,
    bkp_log_path=None,
    max_records=1000,
    max_time=60,
    live_log_prefix="",
)

Bases: BulkRotatingHandlerBase

Handler for logging to a set of files, which switches from one file to the next when the current file reaches a certain size or time.

Open a log file and use it as the stream for logging. when max_records are written, or max_time has passed, a rollover occurs rollover copies the live log from live_log_path to rotated_log_path

Parameters:

Name Type Description Default
live_log_path str

the path to write the live log to

required
rotated_log_path str

the path to write the rotated log to

required
bkp_log_path Optional[str]

the path to write to rotated log to, if writing to rotated_log_path fails

None
max_records int

the maximum number of records to write before rotation

1000
max_time int

the maximum time (in seconds) to wait before rotation

60
live_log_prefix str

the prefix for live log file

''