Error_Log::truncate_log()
Summary
Clean log file if it has size more than set in Troubleshooting_Diagnostics::LOG_FILE_SIZE
Source
File: src/BigCommerce/Logging/Error_Log.php
public function truncate_log() { if ( ! file_exists( $this->log_path ) ) { return; } $log_size = $this->get_log_size_mb(); $max_allowed_size = (int) get_option( Troubleshooting_Diagnostics::LOG_FILE_SIZE, self::MAX_SIZE ); /** * Exit from function if file size lower than set in settings */ if ( $log_size < $max_allowed_size ) { return; } /** * Clean log file contents */ $file = fopen( $this->log_path, "w" ); fclose( $file ); }