Automattic\WooCommerce\Utilities
LoggingUtil::generate_log_file_id()
Generate a public ID for a log file based on its properties.
The file ID is the basename of the file without the hash part. It allows us to identify a file without revealing its full name in the filesystem, so that it's difficult to access the file directly with an HTTP request.
Method of the class: LoggingUtil{}
No Hooks.
Return
String
.
Usage
$result = LoggingUtil::generate_log_file_id( $source, ?int $rotation, $created ): string;
- $source(string) (required)
- The source of the log entries contained in the file.
- ?int $rotation **
- -
Default: null - $created(int)
- The date the file was created, as a Unix timestamp.
LoggingUtil::generate_log_file_id() LoggingUtil::generate log file id code WC 9.4.2
public static function generate_log_file_id( string $source, ?int $rotation = null, int $created = 0 ): string { return File::generate_file_id( $source, $rotation, $created ); }