You can tell error_log() where to put its output:
error_log( 'my debugging output', 3, '/my/debug/log/location/log.txt' );
It might be more convenient to add your own function:
if ( ! function_exists( 'my_debug' ) ) {
function my_debug( $x = '' ) {
// Uses print_r() in case $x isn't a string.
error_log( print_r( $x, 1 ), 3, '/my/debug/log/location/log.txt' );
}
}
// ... elsewhere
my_debug( $the_variable_i_want_to_check );
Related Posts:
- What is the best way to monitor PHP functions/executions?
- How do I set up Debugging?
- add_sub_menu page() to be replaced by add_theme_page()
- Get PHP Fatal error on globalized $wpdb: Call to a member function insert() on a non-object- I have no clue. What to do?
- How to show the error causing the ‘There has been a critical error on your website’?
- How do you change error reporting to only show errors in WordPress?
- How to Debug WordPress
- Error message prevents access to WP
- Getting notices on fresh 3.6.1 install
- WordPress: Notice:Object of class WP_Query could not be converted to int in on line
- Front end empty (i.e. nothing displays); Back end looks fine; What are possible causes?
- WordPress + Buddpyress – troubleshooting server overloading
- Unnessary character on post after restore
- How to find which plugin crashes
- I’m getting this ‘PHP Deprecated’ issue
- Platform sh site setup in localhost gets Cookie error
- Error logging in wordpress
- Critical Error on Pages – WP_DEBUG Not Showing Anything
- Showing errors with $wpdb update
- How to display admin error notice if settings saved succesfully?
- How to fix “There has been a critical error on your website. Please check your site admin email inbox for instructions”?
- When does remove_filter not work?
- This webpage is not available ERR_NAME_NOT_RESOLVED
- Error messages when adding code to function.php or trying to delete inactive plugin files
- WP_DISABLE_FATAL_ERROR_HANDLER vs WP_DEBUG ? What to use and when to use to see errors?
- Call to undefined function get_header() in index.php
- List Category Posts plugin upgrade fails with fatal error
- Dashboard Whitescreen of Death?
- How can I find the cause of theme crashing Apache in Xampplite?
- tb_show is not defined in advance custom field
- How to implement Sentry on WordPress? [closed]
- Get notified by email when Fatal error occurs on wordpress site?
- Is there a way to avoid 404 pages in WordPress?
- “There doesn’t seem to be a wp-config.php file.” despite wp-config.php in root
- How to find error in my code when the error message is pointing to WP core file?
- Unable to Upload Files
- error: An Unexpected HTTP Error occurred during the API request
- I am getting an error some times when uploading themes
- After upgrading Debian Buster to Bullseye, WordPress sites no longer updating
- is_wp_error is missing error
- Error establishing a database connection only on some pages
- Deprecated issue in WordPress [closed]
- Why getting “The input type is invalid” when accessing edit.php?
- Website Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘Wppr_Public’ does not have a method ‘amp_support’
- Debugging: How to determine which plugin is throwing error in plugin.php
- “load-scripts.php” hangs and times out when plupload is requested
- Site Address (URL) – causing error 404
- Object of class stdClass could not be converted to string in
- How to trace an Error when it says nothing about any plugin?
- White Screen on Site but wp-admin OK
- Dummy data error
- require_once() error after moving WordPressto another server
- Internet Explorer cannot display the webpage
- Removed plugin generating error message
- Why do these errors appear on my wordpress site? [closed]
- Error when activating child theme: `failed to open stream: No such file or directory`
- W3 Total Cache “Preview mode could not be disabled” [closed]
- Problem with UTF8. italian/russian characters
- Internal Server Error only on frontend and certain admin pages
- How to automatically convert “%” and “+” in image urls on upload
- Error when trying to logout
- Resolving a 500 Error with GoDaddy Hosting? [closed]
- Fatal error: Uncaught Error: Call to undefined function wp() in /home/nr4dxonhypyy/public_html/wp-blog-header.php:16
- Why I get a blank screen when trying to make wordpress post/pages edits?
- Unable to edit with Elementor
- Getting Download failed. cURL error 28: Connection timed out after 10001 milliseconds
- Critical error but refresh fixes it
- WordPress error when update to new version
- Undefined index when saved to options
- Crawl Errors in Search console
- The TypeError: this.each when wp.media.open() after using popper.js for bootstrap 4
- Parse error: syntax error, unexpected ”tax_query” in wordpress
- Can too-large images cause Error Establishing a Database Connection
- WordPress Dashboard visible but site is not after migration
- Error messages generated in ‘Customize Your Site’
- Undefined Index. But isset not working?
- Logging out gives 404 error
- Internal 500 error: Activating rootio theme and deploying with capistrano
- Error updating WordPress, does not ask for FTP password, just error
- White background, black text – the simplest on earth : “error”!
- Twenty Eleven theme-options error
- Post show up as post and pages
- Random HTTP 500 error in WordPress
- I’m getting Call to undefined function wp_parse_list() out of the blue
- Add clickable function in functions.php – parse error [closed]
- Trying to add function with pre_get_posts for plugin search [closed]
- What are some best practices to clean up http mix content warnings?
- Fatal error due to file permissions
- Language of errors in WordPress admin
- index page is not loading [closed]
- Is it possible to empty debug.log programmatically?
- File doesn’t exist! in wordpress function.php file while creating new post or page
- Change Registration Error Message
- Error code 499 on specific cron job
- Please Help Me, How to Fix PHP Error Undefined Array Key “srcset”
- My websit dosent worke http errors 500
- Customizing login message
- PHP Parse error: syntax error, unexpected token “endwhile” [closed]
- Fatal error on random blog posts
- How to hook into debug.log?