Skip to content

GigaOM/go-slog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gigaom Slog

Description

A way to log occurrences to the Loggly API (requires separate Loggly account and Gigaom Loggly).

Why Does This Exist?

We originally created this to allow us to log errors in our code when we weren't able to access the PHP error logs on the server and weren't able to reproduce them locally. However, since then we've found it useful in a few other cases as well.

Here's our short list (you may be able to think of more):

  1. When you need to log errors but don't have admin access to the error logs on the server.
  2. When you need a consolidated log between two different servers that are running related code.
    • In our case we had two servers talking to each other and needed a view into how that conversation was going in a consolidated fashion.
  3. When you have a rare error that you need to log but don't want to dig through months of error log files.

Usage Notes

  1. All necessary config info is already set up in Gigaom Loggly.
    • All log entries are stored on the Loggly account dashboard at https://{account_name}.loggly.com for the duration specified in their service plan.
  2. Log items: do_action( 'go_slog', $code, $message, $data );
    • $code - Some error code string (e.g. warning, error, error-type-1, etc...)
    • $message - Some error message (e.g. Attempt to contact the endpoint failed.)
    • $data - An array of data that will be helpful in debugging (e.g. array( 'post_id' => 131, 'post_title' => 'Test Post' ))
    • Notes:
      • Loggly stores 1Mb per log event uploaded via their API, in batches limited to no larger than 5Mb.
      • Log items will also automatically contain the originating domain, and file (if available class and function will also be included)
  3. View Slog: /wp-admin/tools.php?page=go-slog-show
    • Slogs can be paged through going back up to a week back.
    • The advantage of using this view is that it only returns go-slog'd entries sorted into the code, message, data columns. Similar filtering, and more fine-grained search is of course readily available on the Loggly account dashboard.

Report Issues, Contribute Code, or Fix Stuff

https://github.com/GigaOM/go-slog/

About

A way to log occurances to an Amazon Simple DB (requires Gigaom Simple DB).

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 6