WP Manifestindependent plugin directory
manifest / developer / simple-logger-for-loggly

Simple Logger for Loggly

WordPress integration of a Simple PHP Logging API for Loggly

★ 1stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/sc0ttkclark/simple-logger-for-loggly/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

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/ ' );