WC_Log_Handler_File::get_log_file_name( string $handle )

Get a log file name.


Description Description

File names consist of the handle, followed by the date, followed by a hash, .log.


Parameters Parameters

$handle

(Required) Log name.


Top ↑

Return Return

(bool|string) The log file name or false if cannot be determined.


Top ↑

Source Source

File: includes/log-handlers/class-wc-log-handler-file.php

	public static function get_log_file_name( $handle ) {
		if ( function_exists( 'wp_hash' ) ) {
			$date_suffix = date( 'Y-m-d', time() );
			$hash_suffix = wp_hash( $handle );
			return sanitize_file_name( implode( '-', array( $handle, $date_suffix, $hash_suffix ) ) . '.log' );
		} else {
			wc_doing_it_wrong( __METHOD__, __( 'This method should not be called before plugins_loaded.', 'woocommerce' ), '3.3' );
			return false;
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.