WordPress Error log redirect into specific file
add this code in the wp-config.php file
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true );
And add this line of code into the functions.php in theme.
NOTE:
for child theme
get_stylesheet_directory()
if the theme is a child theme than use this for path to the debug.log file.
for parent theme use thisget_template_directory()function alert_meErros(){ ini_set( 'error_log', get_template_directory(). '/debug.log' ); } add_action( 'init', 'alert_meErros', 10 );and create a file as this example ( debug.log ) inside your theme of somewhere else in the WordPress.
This is an example of catched error details.
[08-Aug-2022 15:29:17 UTC] PHP Fatal error: Uncaught Error: Call to undefined function hello() in C:\xampp\htdocs\wp\wp-content\themes\zazaki\index.php:6
Stack trace:
#0 C:\xampp\htdocs\wp\wp-includes\template-loader.php(106): include()
#1 C:\xampp\htdocs\wp\wp-blog-header.php(19): require_once('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\wp\index.php(17): require('C:\\xampp\\htdocs...')
#3 {main}
thrown in C:\xampp\htdocs\wp\wp-content\themes\zazaki\index.php on line 6
50 Related pages
- About WordPress
- Child pages and Related pages display
- Display all posts title on any page, WordPress
- Display child pages of specific page anywhere, WordPress
- Display child pages of the current page, WordPress
- Display date the page created, WordPress
- Display related pages, WordPress
- dns-prefetch, remove, WordPress
- Featured image, WordPress
- Get all parent pages, WordPress
- Get current page ID, WordPress
- Get ID of most top page, WordPress
- Get parent title as URL link
- Hook to head with wp_head
- If has category, WordPress
- If has tag, WordPress
- If page is parent or child page, WordPress
- Implementing website design into the WordPress with minimum requirements
- Increase Maximum Upload File Size, WordPress
- List child pages of a specific page, WordPress
- List subpages even if on a subpage, WordPress
- Parent, Child and Grandchild page
- Show pages in the index page, WordPress
- Show related pages even on the subpage, WordPress
- WordPress Addmin Toolbar position
- WordPress count child pages
- WordPress Display child pages
- WordPress display single page by ID
- WordPress Error log redirect into specific file
- WordPress get template directory and uri
- WordPress post type icon
- WordPress Show only parent pages
- WordPress wp_enqueue_style
- WordPress, display all pages in website, Dropdown option select
- WordPress, display child and grandchild pages
- WordPress, Display parent pages only
- WordPress, Parent page has number of child pages
- WP Avenced Search
- WP Basic for WordPress Theme
- WP cache
- WP count children of parent page
- WP count page, post or custom post type
- WP count related pages
- WP Count taxonomy-name
- WP function with shortcode
- WP functions with shortcode
- WP generate theme online
- WP image exist
- WP plugin exists or active
- WP remove global styles from the head