Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Enable and Monitor debug.log #23

Closed
kingkool68 opened this issue Jun 26, 2017 · 0 comments
Closed

Enable and Monitor debug.log #23

kingkool68 opened this issue Jun 26, 2017 · 0 comments

Comments

@kingkool68
Copy link
Contributor

The nginx error log is being monitored but WordPress' built in debug logging functionality would be another place to monitor for errors. To do this we need to modify wp-config.php so WP_DEBUG is enabled by default:

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
if ( isset( $_GET['debug'] ) && $_GET['debug'] == '!wr8KCsv9V7%' ) {
    define( 'WP_DEBUG_DISPLAY', true );
    define( 'SAVEQUERIES', true );
} else {
    define( 'WP_DEBUG_DISPLAY', false );
}

We also need to tell the AWS CloudWatch log monitor of the new log we want to track by appending a new config to /var/awslogs/etc/awslogs.conf

[/var/www/spiritedmedia.com/htdocs/wp-content/debug.log]
datetime_format = %d-%b-%Y %H:%M:%S 
file = /var/www/spiritedmedia.com/htdocs/wp-content/debug.log
buffer_duration = 5000
log_stream_name = spiritedmedia.com
initial_position = start_of_file
log_group_name = /var/www/spiritedmedia.com/htdocs/wp-content/debug.log

Be sure to stop and start the logging daemon:

sudo service awslogs stop then sudo service awslogs start

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant