dev-master
9999999-devMonolog Splunk Handler based on easylo wrapper
MIT
The Requires
by Andy Schwarz
monolog splunk easylo
Monolog Splunk Handler based on easylo wrapper
Simple monolog wrapper for the Easylo Splunk SDK., (*1)
Install, (*2)
composer require flyandi/monolog-splunk-handler
How to use, (*3)
use flyandi/Monolog/Handler/SplunkHandler;
Invoke Handler, (*4)
$handlers[] = new SplunkHandler( (string) <Source>, (array, optional) <ConnectionParameters>, (array, optional) <OptionalParameters>, (const, optional) level, (boolean, optional) bubble );
Connection parameter is an array with various options. It supports all connection variants for Splunk including user and token authentication., (*5)
username: (optional) The username to login with. Defaults to "admin"., (*6)
password: (optional) The password to login with. Defaults to "changeme"., (*7)
token: (optional) The authentication token to use. If provided, the username and password are ignored and there is no need to call login(). In the format Splunk SESSION_KEY
., (*8)
host: (optional) The hostname of the Splunk server. Defaults to "localhost"., (*9)
port: (optional) The port of the Splunk server. Defaults to 8089., (*10)
scheme: (optional) The scheme to use: either "http" or "https". Defaults to "https"., (*11)
namespace: (optional) Namespace that all object lookups will occur in by default. Defaults to Splunk_Namespace::createDefault()
., (*12)
http: (optional) An Http object that will be used for performing HTTP requests. This is intended for testing only., (*13)
Optional parameters are included in every log. This is useful if you want to log additional items like user or session data., (*14)
Example, (*15)
$data = [ "user" => "Foo", "environment" => "Production", "version" => "1.0", "remoteBrowser" => $env["HTTP_USER_BROWSER"] ];
Monolog Splunk Handler based on easylo wrapper
MIT
monolog splunk easylo