Does WordPress provide different levels of logging?

Your understand is correct. WordPress doesn’t have levels beyond Warning and Error from PHP. Wonolog, a WordPress wrapper for Monolog, expands the default error logging into the levels you require. You can also expand the logging by adding your own custom debuging alerts and level.

How to dump/log default values that are passed to hooks/filter functions?

If you want to keep your log on the server, try using php’s error_log() which is more flexible than just writing to files on disk. Something along the lines of: add_filter(‘manage_edit-member_columns’, ‘set_custom_edit_member_columns’); function set_custom_edit_member_columns($columns) { error_log(print_r($columns,true),3,__DIR__.”/log.txt”); $columns[‘photo’] = “Photo”; return $columns; } OTOH, if you find the browser console more convenient, you should include a … Read more

Logging Count of Those Who Read Whole Post (ie reach the bottom)

Places to start: Detecting Bottom of the page Once you have detected you’re at the bottom, you’ll need to make an AJAX request using WP AJAX (tutorial) to save that data. You’ll probably want to store “read_whole_post” as a postmeta value. Something along the lines of this: add_action( ‘wp_ajax_read_whole_post’, ‘se200479_read_whole_post’ ); add_action( ‘wp_ajax_nopriv_read_whole_post’, ‘se200479_read_whole_post’ ); … Read more

Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

A quick manual solution is to direct all error output to a log file somewhere or even to /dev/null. With your command this would look like this: wp plugin list –fields=name,status,update,version,update_version,title –format=json 2> ./cli-command.err.log If you totally don’t care about the errors, warnings and notices, you could send it to /dev/null like this: wp plugin … Read more

Using separate Apache log files for multisite

You could set up custom logs in your httpd-vhosts.conf depending on the HTTP_HOST variable – if your server is an Apache and you use subdomains for each single site. For sub directories (not tested): SetEnvIf Request_URI ^sitename1 sitename1 SetEnvIf Request_URI ^sitename2 sitename2 CustomLog sitename1.log common env=sitename1 CustomLog sitename2.log common env=sitename2

Log of Heartbeat Calls

From quick look at the code, there is number of hooks firing in wp_ajax_heartbeat(). Out of which heartbeat_tick action seems quite appropriate to hook some logging logic too. For the sake of completeness, while you are interested in logged in activity, the hook would be heartbeat_nopriv_tick for logged out users.

Does the debug.log do log rotation?

No, it creates only one file. There is no log rotation involved. But… Sometimes “but” can be a good thing 😉 WP uses error_log for its debug log, so you can change its location using: ini_set( ‘error_log’, WP_CONTENT_DIR . ‘/debug-‘ . date(‘Y-m-d’) . ‘.log’ );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)