I had a similar problem: calling error_log() from wp-config.php works, but calling it from functions.php does not work for me.
I couldn’t solve this issue but I’ve found a workaround that allowed me to do some sort of debugging at least. I gave up on error_log() and just wrote an own function that logs into a given file:
function mylog($txt) {
file_put_contents('/home/myuser/logs/mylog.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);
}
Related Posts:
- “Undefined index” error when saving empty array with checkboxes
- error_log() output for print_r() appearing on page
- Hide php Notices in Dashboard
- “Notice: Undefined variable: content” is showing [closed]
- Same log message keeps on printing to debug.log file thousand of times
- How to find error in my code when the error message is pointing to WP core file?
- Mute Debug Messages from Plugins
- XAMPP-VM Mac OS Mojave wordpress debugging using XDebug
- How to display only specific Error types in debug.log? No notices, warnings, etc
- Notice: Undefined index: post_title error
- WordPress won’t display errors at all
- WordPress White Screen Error
- How to fix the admin menu margin-top bug in WordPress 5.5?
- Should I use spl_autoload_register() in my plugin?
- WP-CLI – Selecting PHP version
- Suppress deprecated notices
- What is the best way to monitor PHP functions/executions?
- PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- WSOD but WP_DEBUG not giving any errors
- Does the debug.log do log rotation?
- How do I set up Debugging?
- get_the_content if it contains multiple lines it results in SyntaxError
- Where exactly do I write define( ‘WP_DEBUG’, true ) in wp-config file
- How to resolve error “Cookies are blocked due to unexpected output.”?
- Enable errors PHP WordPress 5.2
- Fatal error: Call to undefined function wpsc_cart_item_count()
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- Using FirePHP with WordPress
- Debugging PHP object during Ajax call in WordPress
- After upgrading to PHP 7.0 my contact form outputs error
- Does WordPress have a built in reference to the PHP version its running under? [closed]
- Can WordPress email the admin about PHP errors, while hiding them from the site?
- how to trace notice warning on core function is_page() & is_singular in class-wp-query.php
- White Screen of Death – wp-admin
- Ajax return code 400
- Get PHP Fatal error on globalized $wpdb: Call to a member function insert() on a non-object- I have no clue. What to do?
- WordPress 5 WP REST routes – No errors
- get_term_link() returns correct – But illogical error-messages disturb
- PHP Warning: Attempt to read property “term_id” on bool
- How to debug my custom login form looping intermittently
- Error on wp_default_style After upgrade to php 7
- Headers already sent in Pluggable.php / homepage and wp-login error
- Why does WordPress keep showing me error messages?
- Warning: Illegal string offset on theme options page [closed]
- PHP if statement works in template files, but not header
- PHP-warning in post-template.php and no loading content on pages
- Parse error: syntax error, unexpected ‘}’ [closed]
- Array to string conversion error in PHP 7.2 when returning user role as class
- PHP E_WARNING being shown despite php.ini [closed]
- can’t get errors
- Cannot load media and I get “PHP Warning: Invalid argument supplied for foreach(“
- Fatal Error wp-settings.php on line 119
- Trying to display terms from custom taxonomy within function
- Help with accessing wp-admin page and resolving error messages
- Blog suddenly shows Archive instead of index page
- Programmatically revert to backup .htaccess a possibility?
- Prevent post from being published and show error
- WordPress 6.x / PHP 8.x deprecated warnings in development environment
- Can’t log in to WordPress wp-admin after adding code to functions.php
- White screen after migrating site, but wp-admin works fine. Disabling all plugins, applying default theme and enabling debug mode does nothing
- var_dump() and print_r() display null in php
- Fatal error: wp-settings.php on line 199
- WordPress Bad Request Error 400
- How to identify which php file a plugin is using on page load?
- Trying to get property ‘ID’ and ‘post_author’ of non-object error
- HELP: cannot log into wordpress. PHP error
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) on single.php
- The link you followed has expired. Please try again
- PHP error on local server install
- Site title not showing. Please help me
- PHP Error in WordPress Theme
- WordPress database error only while loading page for 1st time
- This occurs when I open admin or front on localhost
- How to send logs to plugin owner for a plugin?
- (Xdebug Profiler) Why are there two cachegrind files generated for one page?
- Plugin debugging with errors in activation routine
- Stripe button is not working in a template page
- Unnessary character on post after restore
- How to find the function which is outputting Array
- Functions are causing errors
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Warning: Cannot modify header information (with a twist)
- Troubleshooting “loopback requests that take too long”
- Query Concatenation
- WP Debug enabled Undefined index error in a widget
- What does that mean: cannot use a scalar value as an array [closed]
- How to quickly/easily make an analysis (reverse engineering) of WordPress?
- How to handle PHP parse errors?
- which php or css file has generated an inline style in WordPress that overwrites my css
- Please help! Parse error: syntax error, unexpected ‘
- PHP warning $post->ID is null
- Execute multiple PHP Snippets causes error?
- Use of undefined constant issue
- WordPress 6.1.1 shows deprecated errors with PHP 8.1 & 8.2
- taxonomy pages returning “NULL” when running default WordPress function ‘get_queried_object()’
- PHP Warning: Undefined array key “HTTP_REFERER”
- Warning: Undefined variable $post_id
- Critical Error on Pages – WP_DEBUG Not Showing Anything
- There has been a critical error on this website – wordpress issue after upgrading PHP