Logging and monitoring in Wordpress

Preview:

Citation preview

Logging & MonitoringKnowing your shit

by Tobias Nyholm

Logging

Logging?

Logging

Composer?

–Johnny Appleseed

“Type a quote here.” Tagged version 1

LoggingJordi Boggiano @seldaek

Talk overview

About me• Tobias Nyholm, @tobiasnyholm

• Happyr.com

• Co-host of Sound of Symfony podcast

• Organizer of PHP Stockholm

What do you do today?

Google analyticsUser statistics What pages visited Time spent on the site How the users moves Where they come from etc…

Comment was created Call to API Media uploaded Plugins activated Data fetched

We want to log more

Example logging

Use monolog

Use monologLog with different levels Use streams No issue with locking Extendable!

Use Wordpress hooks

https://codex.wordpress.org/Plugin_API/Action_Reference

Use Activity Log plugin

Log exceptions

Log exceptions

Monolog handlers

Monolog handlers

RecapApplication events Exceptions

Use Monolog Everything put into one file

We got tons of entries

Log files/var/www/my_site/log.txt /var/log/php5-fpm.log /var/log/php5-fpm/access.log /var/log/php5-fpm/errors.log /var/log/php5-fpm/slow.log /var/log/apache2/access.log /var/log/apache2/error.log /var/log/syslog

I introduce to you: A logging server!

Logging serverGraylog 2

Elastic stack (former Elk)

Demo images on graylog

–Johnny Appleseed

“Type a quote here.”

I introduce to you: New Relic

–Johnny Appleseed

“Type a quote here.”

–Johnny Appleseed

“Type a quote here.”

–Johnny Appleseed

“Type a quote here.”

Thank you@tobiasnyholm

SeminarsMeetup Lightning talks - April 19th http://www.meetup.com/php-stockholm/events/230222917/

NewRelic workshop - May 3rd http://newrelic.com/rsvp/20160503stockholmapmwkshp

Meetup with PHP security - May 11th http://www.meetup.com/php-stockholm/events/228580453/

Recommended