WC_Log_Handler_File::log_rotate()protectedWC 1.0

Rotate log files.

Logs are rotated by prepending '.x' to the '.log' suffix. The current log plus 10 historical logs are maintained. For example:

base.9.log -> [ REMOVED ]
base.8.log -> base.9.log
...
base.0.log -> base.1.log
base.log   -> base.0.log

Method of the class: WC_Log_Handler_File{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->log_rotate( $handle );
$handle(string) (required)
Log handle.

WC_Log_Handler_File::log_rotate() code WC 8.7.0

protected function log_rotate( $handle ) {
	for ( $i = 8; $i >= 0; $i-- ) {
		$this->increment_log_infix( $handle, $i );
	}
	$this->increment_log_infix( $handle );
}