WC_Log_Handler_File::log_rotate
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.
Returns
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() WC Log Handler File::log rotate code WC 10.3.3
protected function log_rotate( $handle ) {
for ( $i = 8; $i >= 0; $i-- ) {
$this->increment_log_infix( $handle, $i );
}
$this->increment_log_infix( $handle );
}