Skip to content

sc0ttkclark/simple-logger-for-loggly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Logger for Loggly

This is a small plugin that integrates Loggly logging with WordPress.

Configuration

The configuration is currently all done via PHP constants that you can define in your wp-config.php file.

Required

Token

You MUST set a token to use the API. All other configuration is optional.

See https://{username}.loggly.com/tokens/ to get your token.

define( 'SIMPLE_LOGGER_FOR_LOGGLY_TOKEN', 'abcdef' );

Optional

PHP error handling

You can enable automatic integration with PHP error logs.

The default is off.

define( 'SIMPLE_LOGGER_FOR_LOGGLY_ERROR_HANDLER', true );

Customize PHP error log level

You can customize the error log level to log to Loggly. It uses the same values as error_reporting().

The default level is to log all errors (E_ALL).

// Log only deprecation messages.
define( 'SIMPLE_LOGGER_FOR_LOGGLY_ERROR_LOG_LEVEL', E_DEPRECATED );

Customize log destination

You can customize the destination if needed or if you want to customize how it gets tagged. It must contain a "%s" for the token to be set in it dynamically.

The default is https://logs-01.loggly.com/inputs/%s/tag/http/

define( 'SIMPLE_LOGGER_FOR_LOGGLY_DESTINATION', 'https://logs-01.loggly.com/inputs/%s/tag/mytag/ ' );

About

WordPress integration of a Simple PHP Logging API for Loggly

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Contributors

Languages