Skip to content

bulk_rotating_handler_base

messageflux.logging.bulk_rotating_handler_base

BulkRotatingHandlerBase

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

Bases: BaseRotatingHandler

Handler for logging to a destination, while using a rotating "live" file, which rotates "into" its destination 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 the "destination"

Parameters:

Name Type Description Default
live_log_path str

the path to write the live 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

''

close

close()

stops the logger thread and flushes

doRollover

doRollover()

Do a rollover, as described in init().

shouldRollover

shouldRollover(record)

Determine if rollover should occur.

Basically, see if the supplied record would cause the file to exceed the size limit we have.