Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Admin_Page_Status::get_logs()

Retrieve an array of log files


Return Return

(array[]) Associative array of log files. The array key is the file "slug" and the value is the file's absolute path.


Top ↑

Source Source

File: includes/admin/class.llms.admin.page.status.php

	private static function get_logs() {

		$result = array();

		// Retrieve all the files in our log directory.
		$files = @scandir( LLMS_LOG_DIR ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- It's okay though.
		if ( ! empty( $files ) ) {
			foreach ( $files as $key => $value ) {

				// Ignore directory dots, directories, and non .log files.
				if ( in_array( $value, array( '.', '..' ), true ) || is_dir( $value ) || ! strstr( $value, '.log' ) ) {
					continue;
				}

				$result[ sanitize_title( $value ) ] = LLMS_LOG_DIR . $value;

			}
		}

		// Add the site's debug.log or native error log file if it exists.
		$err_path = ini_get( 'error_log' );
		if ( $err_path ) {
			$result['debug-log'] = $err_path;
		}

		return $result;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.37.14 Add the WP debug.log file to the array if WP_DEBUG_LOG is enabled.
3.11.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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