. * @since 1.0.0 */ namespace Decalog\Plugin\Feature; use Decalog\System\Option; use DLMonolog\Logger; use Decalog\System\Cache; /** * Define the logger types functionality. * * Handles all available logger types. * * @package Features * @author Pierre Lannoy . * @since 1.0.0 */ class HandlerTypes { /** * The array of available types. * * @since 1.0.0 * @var array $handlers The available types. */ private $handlers = []; /** * The array of available class names. * * @since 3.0.0 * @var array $handlers_class The available class names. */ private $handlers_class = []; /** * Initialize the class and set its properties. * * @since 1.0.0 */ public function __construct() { $this->handlers_class = [ 'alerting' => decalog_esc_html__( 'Crash Analytics', 'decalog' ), 'analytics' => decalog_esc_html__( 'Alerting', 'decalog' ), 'debugging' => decalog_esc_html__( 'Debugging', 'decalog' ), 'logging' => decalog_esc_html__( 'Logging', 'decalog' ), 'metrics' => decalog_esc_html__( 'Monitoring', 'decalog' ), 'tracing' => decalog_esc_html__( 'Tracing', 'decalog' ), ]; // TRACING $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'DatadogTracingHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => 'Datadog Traces', 'help' => decalog_esc_html__( 'Traces sent to Datadog via Datadog local agent.', 'decalog' ), 'icon' => $this->get_base64_datadog_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The format in which to push data.', 'decalog' ), 'default' => 300, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => false, 'list' => [ [ 300, 'DD/0.3' ] ], ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send spans. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:8126', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'ftags' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Custom tags', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'Custom tags to add to each span. Format: %s.', 'decalog' ), '' . htmlentities( 'key=value, key=value …' ) . '' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'format', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'ftags', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'JaegerTracingHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => 'Jaeger', 'help' => decalog_esc_html__( 'Traces sent to a Jaeger collector.', 'decalog' ), 'icon' => $this->get_base64_jaeger_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The format in which to push data.', 'decalog' ), 'default' => 200, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 100, 'Zipkin V2' ], [ 200, 'Jaeger thrift over HTTP' ] ], ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send spans. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:14268', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'service' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service name', 'decalog' ), /* translators: "Jaeger thrift over HTTP" must not be translated because it is a "product name". */ 'help' => decalog_esc_html__( 'Name of the service to use when "Jaeger thrift over HTTP" is the selected format.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'WordPress', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'ftags' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Custom tags', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'Custom tags to add to each span. Format: %s.', 'decalog' ), '' . htmlentities( 'key=value, key=value …' ) . '' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'format', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'ftags', ], [ 'type' => 'configuration', 'value' => 'service', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'TempoTracingHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => 'Tempo', 'help' => decalog_esc_html__( 'Traces sent to a Tempo instance.', 'decalog' ), 'icon' => $this->get_base64_tempo_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The format in which to push data.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 100, 'Zipkin V2' ], [ 200, 'Jaeger thrift over HTTP' ] ], ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send spans. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:9411', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'service' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service name', 'decalog' ), /* translators: "Jaeger thrift over HTTP" must not be translated because it is a "product name". */ 'help' => decalog_esc_html__( 'Name of the service to use when "Jaeger thrift over HTTP" is the selected format.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'WordPress', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'ftags' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Custom tags', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'Custom tags to add to each span. Format: %s.', 'decalog' ), '' . htmlentities( 'key=value, key=value …' ) . '' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'format', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'ftags', ], [ 'type' => 'configuration', 'value' => 'service', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'GrafanaTracingHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => 'Grafana Cloud Traces', 'help' => decalog_esc_html__( 'Traces sent to Grafana Cloud via Grafana agent.', 'decalog' ), 'icon' => $this->get_base64_grafana_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The format in which to push data.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 100, 'Zipkin V2' ], [ 200, 'Jaeger thrift over HTTP' ] ], ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send spans. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:9411', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'service' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service name', 'decalog' ), /* translators: "Jaeger thrift over HTTP" must not be translated because it is a "product name". */ 'help' => decalog_esc_html__( 'Name of the service to use when "Jaeger thrift over HTTP" is the selected format.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'WordPress', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'ftags' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Custom tags', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'Custom tags to add to each span. Format: %s.', 'decalog' ), '' . htmlentities( 'key=value, key=value …' ) . '' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'format', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'ftags', ], [ 'type' => 'configuration', 'value' => 'service', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'ZipkinTracingHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => 'Zipkin', 'help' => decalog_esc_html__( 'Traces sent to a Zipkin instance.', 'decalog' ), 'icon' => $this->get_base64_zipkin_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The format in which to push data.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => false, 'list' => [ [ 100, 'Zipkin V2' ] ], ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send spans. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:9411', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'ftags' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Custom tags', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'Custom tags to add to each span. Format: %s.', 'decalog' ), '' . htmlentities( 'key=value, key=value …' ) . '' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'ftags', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'WordpressTracingHandler', 'namespace' => 'Decalog\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => decalog_esc_html__( 'WordPress traces', 'decalog' ), 'help' => decalog_esc_html__( 'Traces stored in WordPress and available right in your admin dashboard.', 'decalog' ), 'icon' => $this->get_base64_wordpress_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'included' => [ 'WordpressProcessor', 'WWWProcessor', 'IntrospectionProcessor' ], ], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'constant-storage' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Storage', 'decalog' ), 'help' => decalog_esc_html__( 'Place where to store traces.', 'decalog' ) . '
' . decalog_esc_html__( 'Note: it\'s not possible to change storage type after logger creation.', 'decalog' ), 'default' => 'db', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => Cache::$apcu_available, 'list' => [ [ 'db', decalog_esc_html__( 'Database: persistent after a server restart', 'decalog' ) ], [ 'apcu', decalog_esc_html__( 'APCu: high performance but reset after each server reboot', 'decalog' ), Cache::$apcu_available ] ], ], ], 'rotate' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Traces', 'decalog' ), 'help' => decalog_esc_html__( 'Maximum number of traces stored in this traces log (0 for no limit).', 'decalog' ), 'default' => 10000, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 0, 'max' => 10000000, 'step' => 1000, 'enabled' => true, ], ], 'purge' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Days', 'decalog' ), 'help' => decalog_esc_html__( 'Maximum age of traces stored in this traces log (0 for no limit).', 'decalog' ), 'default' => 5, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 0, 'max' => 730, 'step' => 1, 'enabled' => true, ], ], 'local' => [ 'type' => 'boolean', 'show' => is_multisite(), 'name' => decalog_esc_html__( 'Multisite partitioning', 'decalog' ), 'help' => decalog_esc_html__( 'Local administrators can view traces that relate to their site.', 'decalog' ), 'default' => false, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'compute', 'value' => 'tablename', ], [ 'type' => 'configuration', 'value' => 'constant-storage', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'NewrelicTracingHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'tracing', 'minimal' => Logger::EMERGENCY, 'name' => 'New Relic Traces', 'help' => decalog_esc_html__( 'Traces sent to New Relic (NR-Traces).', 'decalog' ), 'icon' => $this->get_base64_newrelic_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [ 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The format in which to push data.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => false, 'list' => [ [ 100, 'Zipkin V2' ] ], ], ], 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Location', 'decalog' ), 'help' => decalog_esc_html__( 'The New Relic endpoint location.', 'decalog' ), 'default' => 'https://trace-api.newrelic.com/trace/v1', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'https://trace-api.eu.newrelic.com/trace/v1', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'https://trace-api.newrelic.com/trace/v1', decalog_esc_html__( 'United States', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'II key', 'decalog' ), 'help' => decalog_esc_html__( 'An account\'s "Insights insert key".', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'ftags' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Custom tags', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'Custom tags to add to each span. Format: %s.', 'decalog' ), '' . htmlentities( 'key=value, key=value …' ) . '' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'ftags', ], ], ]; // MONITORING $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'NewRelicMonitoringHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'metrics', 'minimal' => Logger::EMERGENCY, 'name' => 'New Relic Metrics', 'help' => decalog_esc_html__( 'Metrics sent to New Relic (NR-Metrics).', 'decalog' ), 'icon' => $this->get_base64_newrelic_icon(), 'needs' => [], 'params' => [], 'processors' => [], 'configuration' => [ 'profile' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Profile', 'decalog' ), 'help' => sprintf(decalog__( 'The type of metrics to collect (%s). Choosing "Automatic" sets the profile to the current WordPress environment type.', 'decalog' ), sprintf( '%s', decalog_esc_html__( 'details', 'decalog' ) ) ), 'default' => 500, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 500, decalog_esc_html__( 'Automatic', 'decalog' ) ], [ 600, decalog_esc_html__( 'Production', 'decalog' ) ], [ 550, decalog_esc_html__( 'Development', 'decalog' ) ] ], ], ], 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'filter' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Metrics filter', 'decalog' ), 'help' => decalog_esc_html__( 'Exclude metrics to be collated by specifying them with regular expressions (one expression per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' core_wordpress_content_status_(?:draft|pending|inherit)', 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Location', 'decalog' ), 'help' => decalog_esc_html__( 'The New Relic endpoint location.', 'decalog' ), 'default' => 'https://metric-api.newrelic.com/metric/v1', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'https://metric-api.eu.newrelic.com/metric/v1', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'https://metric-api.newrelic.com/metric/v1', decalog_esc_html__( 'United States', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'II key', 'decalog' ), 'help' => decalog_esc_html__( 'An account\'s "Insights insert key".', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'profile', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'filter', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'DatadogMonitoringHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'metrics', 'minimal' => Logger::EMERGENCY, 'name' => 'Datadog Metrics', 'help' => decalog_esc_html__( 'Metrics sent to Datadog.', 'decalog' ), 'icon' => $this->get_base64_datadog_icon(), 'needs' => [], 'params' => [], 'processors' => [], 'configuration' => [ 'profile' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Profile', 'decalog' ), 'help' => sprintf(decalog__( 'The type of metrics to collect (%s). Choosing "Automatic" sets the profile to the current WordPress environment type.', 'decalog' ), sprintf( '%s', decalog_esc_html__( 'details', 'decalog' ) ) ), 'default' => 500, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 500, decalog_esc_html__( 'Automatic', 'decalog' ) ], [ 600, decalog_esc_html__( 'Production', 'decalog' ) ], [ 550, decalog_esc_html__( 'Development', 'decalog' ) ] ], ], ], 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'filter' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Metrics filter', 'decalog' ), 'help' => decalog_esc_html__( 'Exclude metrics to be collated by specifying them with regular expressions (one expression per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' core_wordpress_content_status_(?:draft|pending|inherit)', 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Location', 'decalog' ), 'help' => decalog_esc_html__( 'The Datadog cloud location.', 'decalog' ), 'default' => 'https://http-intake.logs.datadoghq.com/v1/input', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'https://api.datadoghq.eu/api/v1/series', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'https://api.datadoghq.com/api/v1/series', decalog_esc_html__( 'United States', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'API key', 'decalog' ), 'help' => decalog_esc_html__( 'The API key of the service.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'profile', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'filter', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'InfluxMonitoringHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'metrics', 'minimal' => Logger::EMERGENCY, 'name' => 'InfluxDB 2', 'help' => decalog_esc_html__( 'Metrics sent to InfluxDB Cloud or on-premise InfluxDB 2 instance or cluster.', 'decalog' ), 'icon' => $this->get_base64_infuxdb_icon(), 'needs' => [], 'params' => [], 'processors' => [], 'configuration' => [ 'profile' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Profile', 'decalog' ), 'help' => sprintf(decalog__( 'The type of metrics to collect (%s). Choosing "Automatic" sets the profile to the current WordPress environment type.', 'decalog' ), sprintf( '%s', decalog_esc_html__( 'details', 'decalog' ) ) ), 'default' => 500, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 500, decalog_esc_html__( 'Automatic', 'decalog' ) ], [ 600, decalog_esc_html__( 'Production', 'decalog' ) ], [ 550, decalog_esc_html__( 'Development', 'decalog' ) ] ], ], ], 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'filter' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Metrics filter', 'decalog' ), 'help' => decalog_esc_html__( 'Exclude metrics to be collated by specifying them with regular expressions (one expression per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' core_wordpress_content_status_(?:draft|pending|inherit)', 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send metrics. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:8086', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'org' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Organization', 'decalog' ), 'help' => decalog_esc_html__( 'Organization name to use (must exist).', 'decalog' ) . $this->get_substitution_note(), 'default' => 'my-org', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'bucket' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Bucket', 'decalog' ), 'help' => decalog_esc_html__( 'Bucket name to use (must exist).', 'decalog' ) . $this->get_substitution_note(), 'default' => 'my-bucket', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Token', 'decalog' ), 'help' => decalog_esc_html__( 'Token value to write in bucket.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'my-token', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'profile', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'org', ], [ 'type' => 'configuration', 'value' => 'bucket', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'filter', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'PrometheusMetricsEPHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'metrics', 'minimal' => Logger::EMERGENCY, 'name' => 'Prometheus Endpoint', 'help' => decalog_esc_html__( 'Metrics published on this site as polling endpoint.', 'decalog' ), 'icon' => $this->get_base64_prometheus_icon(), 'needs' => [], 'params' => [], 'processors' => [], 'configuration' => [ 'profile' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Profile', 'decalog' ), 'help' => sprintf(decalog__( 'The type of metrics to collect (%s). Choosing "Automatic" sets the profile to the current WordPress environment type.', 'decalog' ), sprintf( '%s', decalog_esc_html__( 'details', 'decalog' ) ) ), 'default' => 500, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 500, decalog_esc_html__( 'Automatic', 'decalog' ) ], [ 600, decalog_esc_html__( 'Production', 'decalog' ) ], [ 550, decalog_esc_html__( 'Development', 'decalog' ) ] ], ], ], 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'filter' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Metrics filter', 'decalog' ), 'help' => decalog_esc_html__( 'Exclude metrics to be collated by specifying them with regular expressions (one expression per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' core_wordpress_content_status_(?:draft|pending|inherit)', 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'profile', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'filter', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'PrometheusMonitoringHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'metrics', 'minimal' => Logger::EMERGENCY, 'name' => 'Prometheus Pushgateway', 'help' => decalog_esc_html__( 'Metrics sent to a Prometheus Pushgateway instance.', 'decalog' ), 'icon' => $this->get_base64_prometheus_icon(), 'needs' => [], 'params' => [], 'processors' => [], 'configuration' => [ 'profile' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Profile', 'decalog' ), 'help' => sprintf(decalog__( 'The type of metrics to collect (%s). Choosing "Automatic" sets the profile to the current WordPress environment type.', 'decalog' ), sprintf( '%s', decalog_esc_html__( 'details', 'decalog' ) ) ), 'default' => 500, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 500, decalog_esc_html__( 'Automatic', 'decalog' ) ], [ 600, decalog_esc_html__( 'Production', 'decalog' ) ], [ 550, decalog_esc_html__( 'Development', 'decalog' ) ] ], ], ], 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'filter' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Metrics filter', 'decalog' ), 'help' => decalog_esc_html__( 'Exclude metrics to be collated by specifying them with regular expressions (one expression per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' core_wordpress_content_status_(?:draft|pending|inherit)', 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send metrics. Format: %s.', 'decalog' ), '' . htmlentities( '://[:]' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:9091', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'model' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Labels', 'decalog' ), 'help' => decalog_esc_html__( 'Template for labels. If you are unsure of the implications on cardinality, choose the first one.', 'decalog' ), 'default' => 0, 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 0, '{job="x", instance="y"} - ' . decalog_esc_html__( 'Recommended in most cases', 'decalog' ) ], [ 1, '{job="x", instance="y", env="z"} - ' . decalog_esc_html__( 'Classical environment segmentation', 'decalog' ) ], [ 2, '{job="x", instance="y", version="z"} - ' . decalog_esc_html__( 'Classical version segmentation', 'decalog' ) ], [ 3, '{job="x", site="y"} - ' . decalog_esc_html__( 'WordPress Multisite segmentation', 'decalog' ) ] ], ], ], 'id' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Job', 'decalog' ), 'help' => decalog_esc_html__( 'The fixed job name for some templates.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'wp_decalog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'profile', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'model', ], [ 'type' => 'configuration', 'value' => 'id', ], [ 'type' => 'configuration', 'value' => 'filter', ], ], ]; /*$this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'GrafanaMonitoringHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'metrics', 'minimal' => Logger::EMERGENCY, 'name' => 'Grafana Cloud Metrics', 'help' => decalog_esc_html__( 'Metrics sent to Grafana Cloud via Grafana agent.', 'decalog' ), 'icon' => $this->get_base64_grafana_icon(), 'needs' => [], 'params' => [], 'processors' => [], 'configuration' => [ 'profile' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Profile', 'decalog' ), 'help' => sprintf(decalog__( 'The type of metrics to collect (%s). Choosing "Automatic" sets the profile to the current WordPress environment type.', 'decalog' ), sprintf( '%s', decalog_esc_html__( 'details', 'decalog' ) ) ), 'default' => 500, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 500, decalog_esc_html__( 'Automatic', 'decalog' ) ], [ 600, decalog_esc_html__( 'Production', 'decalog' ) ], [ 550, decalog_esc_html__( 'Development', 'decalog' ) ] ], ], ], 'sampling' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Sampling', 'decalog' ), 'help' => decalog_esc_html__( 'Sampling rate to be chosen according to the site traffic.', 'decalog' ), 'default' => 100, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 1000, '100%' ], [ 500, '50%' ], [ 250, '25%' ], [ 100, '10%' ], [ 50, '5%' ], [ 20, '2%' ], [ 10, '1%' ], [ 5, '5‰' ], [ 2, '2‰' ], [ 1, '1‰' ] ], ], ], 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Prometheus host', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'The host name portion of the Prometheus instance url. Something like %s.', 'decalog' ), 'prometheus-us-central1' ), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'user' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Username', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'The user name for Basic Auth authentication. Something like %s.', 'decalog' ), '21087' ), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'key' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'API key', 'decalog' ), 'help' => decalog_esc_html__( 'The Grafana.com API Key.', 'decalog' ), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'model' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Labels', 'decalog' ), 'help' => decalog_esc_html__( 'Template for labels. If you are unsure of the implications on cardinality, choose the first one.', 'decalog' ), 'default' => 0, 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 0, '{job="x", instance="y"} - ' . decalog_esc_html__( 'Recommended in most cases', 'decalog' ) ], [ 1, '{job="x", instance="y", env="z"} - ' . decalog_esc_html__( 'Classical environment segmentation', 'decalog' ) ], [ 2, '{job="x", instance="y", version="z"} - ' . decalog_esc_html__( 'Classical version segmentation', 'decalog' ) ], [ 3, '{job="x", site="y"} - ' . decalog_esc_html__( 'WordPress Multisite segmentation', 'decalog' ) ] ], ], ], 'id' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Job', 'decalog' ), 'help' => decalog_esc_html__( 'The fixed job name for some templates.', 'decalog' ), 'default' => 'wp_decalog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'uuid', ], [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'user', ], [ 'type' => 'configuration', 'value' => 'key', ], [ 'type' => 'configuration', 'value' => 'profile', ], [ 'type' => 'configuration', 'value' => 'sampling', ], [ 'type' => 'configuration', 'value' => 'model', ], [ 'type' => 'configuration', 'value' => 'id', ], ], ];*/ // LOGGING $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'NewRelicHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::INFO, 'name' => 'New Relic Logs', 'help' => decalog_esc_html__( 'Events sent to New Relic (NR-Logs).', 'decalog' ), 'icon' => $this->get_base64_newrelic_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'excluded' => [ 'BacktraceProcessor' ], ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Location', 'decalog' ), 'help' => decalog_esc_html__( 'The New Relic endpoint location.', 'decalog' ), 'default' => 'https://log-api.newrelic.com/log/v1', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'https://log-api.eu.newrelic.com/log/v1', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'https://log-api.newrelic.com/log/v1', decalog_esc_html__( 'United States', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'License key', 'decalog' ), 'help' => decalog_esc_html__( 'The account\'s license key.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'buffer' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Deferred forwarding', 'decalog' ), 'help' => decalog_esc_html__( 'Wait for the full page is rendered before sending reports (recommended).', 'decalog' ), 'default' => true, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'DatadogHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::INFO, 'name' => 'Datadog Events', 'help' => decalog_esc_html__( 'Events sent to Datadog.', 'decalog' ), 'icon' => $this->get_base64_datadog_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Location', 'decalog' ), 'help' => decalog_esc_html__( 'The Datadog cloud location.', 'decalog' ), 'default' => 'https://http-intake.logs.datadoghq.com/v1/input', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'https://http-intake.logs.datadoghq.eu/v1/input', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'https://http-intake.logs.datadoghq.com/v1/input', decalog_esc_html__( 'United States', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'API key', 'decalog' ), 'help' => decalog_esc_html__( 'The API key of the service.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'extended' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Extended fields', 'decalog' ), 'help' => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' hostname={HOSTNAME} ' . decalog_esc_html__( 'or', 'decalog' ) . ' foo=bar ' . decalog_esc_html__( 'or', 'decalog' ) . ' foobar=42.' . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], 'buffer' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Deferred forwarding', 'decalog' ), 'help' => decalog_esc_html__( 'Wait for the full page is rendered before sending reports (recommended).', 'decalog' ), 'default' => true, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'extended', ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'ElasticCloudHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Elastic Cloud - Events', 'help' => decalog_esc_html__( 'Events sent to Elastic Cloud.', 'decalog' ), 'icon' => $this->get_base64_elasticcloud_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'cloudid' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Cloud ID', 'decalog' ), 'help' => decalog_esc_html__( 'The generated cloud ID.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'user' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Username', 'decalog' ), 'help' => decalog_esc_html__( 'The username of the instance.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'pass' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Password', 'decalog' ), 'help' => decalog_esc_html__( 'The password of the instance.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'index' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Index', 'decalog' ), 'help' => decalog_esc_html__( 'The index name.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'decalog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'extended' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Extended fields', 'decalog' ), 'help' => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' hostname={HOSTNAME} ' . decalog_esc_html__( 'or', 'decalog' ) . ' foo=bar ' . decalog_esc_html__( 'or', 'decalog' ) . ' foobar=42.' . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'cloudid', ], [ 'type' => 'configuration', 'value' => 'user', ], [ 'type' => 'configuration', 'value' => 'pass', ], [ 'type' => 'configuration', 'value' => 'index', ], [ 'type' => 'configuration', 'value' => 'extended', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'ElasticHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Elasticsearch - Events', 'help' => decalog_esc_html__( 'Events sent to Elasticsearch.', 'decalog' ), 'icon' => $this->get_base64_elasticsearch_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send logs. Format: %s.', 'decalog' ), '' . htmlentities( '://:' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:9200', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'user' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Username', 'decalog' ), 'help' => decalog_esc_html__( 'The username of the instance.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'pass' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Password', 'decalog' ), 'help' => decalog_esc_html__( 'The password of the instance.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'index' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Index', 'decalog' ), 'help' => decalog_esc_html__( 'The index name.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'decalog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'extended' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Extended fields', 'decalog' ), 'help' => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' hostname={HOSTNAME} ' . decalog_esc_html__( 'or', 'decalog' ) . ' foo=bar ' . decalog_esc_html__( 'or', 'decalog' ) . ' foobar=42.' . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'user', ], [ 'type' => 'configuration', 'value' => 'pass', ], [ 'type' => 'configuration', 'value' => 'index', ], [ 'type' => 'configuration', 'value' => 'extended', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'FluentHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Fluentd', 'help' => decalog_esc_html__( 'Events sent to a Fluentd collector.', 'decalog' ), 'icon' => $this->get_base64_fluentd_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Connection string', 'decalog' ), 'help' => decalog_esc_html__( 'Connection string to Fluentd. Can be something like "tcp://127.0.0.1:24224" or something like "unix:///var/run/td-agent/td-agent.sock".', 'decalog' ) . $this->get_substitution_note(), 'default' => 'tcp://localhost:24224', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'timeout' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Socket timeout', 'decalog' ), 'help' => decalog_esc_html__( 'Max number of milliseconds to wait for the socket.', 'decalog' ), 'default' => 800, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 100, 'max' => 10000, 'step' => 100, 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'timeout', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'GrafanaHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::INFO, 'name' => 'Grafana Cloud Events', 'help' => decalog_esc_html__( 'Events sent to Grafana Cloud (Loki).', 'decalog' ), 'icon' => $this->get_base64_grafana_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Loki host', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'The host name portion of the Loki instance url. Something like %s.', 'decalog' ), 'logs-prod-us-central1' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'user' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Username', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'The user name for Basic Auth authentication. Something like %s.', 'decalog' ), '21087' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'key' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'API key', 'decalog' ), 'help' => decalog_esc_html__( 'The Grafana.com API Key.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'model' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Labels', 'decalog' ), 'help' => decalog_esc_html__( 'Template for labels. If you are unsure of the implications on cardinality, choose the first one.', 'decalog' ), 'default' => 0, 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 0, '{job="x", instance="y"} - ' . decalog_esc_html__( 'Recommended in most cases', 'decalog' ) ], [ 1, '{job="x", instance="y", level="z"} - ' . decalog_esc_html__( 'Classical level segmentation', 'decalog' ) ], [ 2, '{job="x", instance="y", env="z"} - ' . decalog_esc_html__( 'Classical environment segmentation', 'decalog' ) ], [ 3, '{job="x", instance="y", version="z"} - ' . decalog_esc_html__( 'Classical version segmentation', 'decalog' ) ], [ 4, '{job="x", level="y", env="z"} - ' . decalog_esc_html__( 'Double level / environment segmentation', 'decalog' ) ], [ 5, '{job="x", site="y"} - ' . decalog_esc_html__( 'WordPress Multisite segmentation', 'decalog' ) ] ], ], ], 'id' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Job', 'decalog' ), 'help' => decalog_esc_html__( 'The fixed job name for some templates.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'wp_decalog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'extended' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Extended fields', 'decalog' ), 'help' => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' hostname={HOSTNAME} ' . decalog_esc_html__( 'or', 'decalog' ) . ' foo=bar ' . decalog_esc_html__( 'or', 'decalog' ) . ' foobar=42.' . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'user', ], [ 'type' => 'configuration', 'value' => 'key', ], [ 'type' => 'configuration', 'value' => 'model', ], [ 'type' => 'configuration', 'value' => 'id', ], [ 'type' => 'configuration', 'value' => 'extended', ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'LogentriesHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Logentries & insightOps', 'help' => decalog_esc_html__( 'Events sent to Logentries & insightOps service.', 'decalog' ), 'icon' => $this->get_base64_logentries_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Log endpoint region', 'decalog' ), 'help' => decalog_esc_html__( 'The region of remote host receiving messages.', 'decalog' ), 'default' => 'eu', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'eu', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'us', decalog_esc_html__( 'USA', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Log token', 'decalog' ), 'help' => decalog_esc_html__( 'The token of the Logentries/insightOps log.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'timeout' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Socket timeout', 'decalog' ), 'help' => decalog_esc_html__( 'Max number of milliseconds to wait for the socket.', 'decalog' ), 'default' => 800, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 100, 'max' => 10000, 'step' => 100, 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'timeout', ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'LogglyHandler', 'namespace' => 'DLMonolog\\Handler', 'class' => 'logging', 'minimal' => Logger::WARNING, 'name' => 'Loggly', 'help' => decalog_esc_html__( 'Events sent to Solawinds Loggly service.', 'decalog' ), 'icon' => $this->get_base64_loggly_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Application token', 'decalog' ), 'help' => decalog_esc_html__( 'The token of the Solawinds Loggly application.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'LokiHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::INFO, 'name' => 'Loki', 'help' => decalog_esc_html__( 'Events sent to a Loki instance.', 'decalog' ), 'icon' => $this->get_base64_loki_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'url' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Service URL', 'decalog' ), 'help' => sprintf( decalog_esc_html__( 'URL where to send logs. Format: %s.', 'decalog' ), '' . htmlentities( '://:' ) . '' ) . $this->get_substitution_note(), 'default' => 'http://localhost:3100', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'model' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Labels', 'decalog' ), 'help' => decalog_esc_html__( 'Template for labels. If you are unsure of the implications on cardinality, choose the first one.', 'decalog' ), 'default' => 0, 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 0, '{job="x", instance="y"} - ' . decalog_esc_html__( 'Recommended in most cases', 'decalog' ) ], [ 1, '{job="x", instance="y", level="z"} - ' . decalog_esc_html__( 'Classical level segmentation', 'decalog' ) ], [ 2, '{job="x", instance="y", env="z"} - ' . decalog_esc_html__( 'Classical environment segmentation', 'decalog' ) ], [ 3, '{job="x", instance="y", version="z"} - ' . decalog_esc_html__( 'Classical version segmentation', 'decalog' ) ], [ 4, '{job="x", level="y", env="z"} - ' . decalog_esc_html__( 'Double level / environment segmentation', 'decalog' ) ], [ 5, '{job="x", site="y"} - ' . decalog_esc_html__( 'WordPress Multisite segmentation', 'decalog' ) ] ], ], ], 'id' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Job', 'decalog' ), 'help' => decalog_esc_html__( 'The fixed job name for some templates.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'wp_decalog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'extended' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Extended fields', 'decalog' ), 'help' => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' hostname={HOSTNAME} ' . decalog_esc_html__( 'or', 'decalog' ) . ' foo=bar ' . decalog_esc_html__( 'or', 'decalog' ) . ' foobar=42.' . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'url', ], [ 'type' => 'configuration', 'value' => 'model', ], [ 'type' => 'configuration', 'value' => 'id', ], [ 'type' => 'configuration', 'value' => 'extended', ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'ErrorLogHandler', 'namespace' => 'DLMonolog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => decalog_esc_html__( 'PHP error log', 'decalog' ), 'help' => decalog_esc_html__( 'Events stored in the standard PHP error log, as with the error_log() function, but more detailed.', 'decalog' ), 'icon' => $this->get_base64_php_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [], 'init' => [ [ 'type' => 'literal', 'value' => 0, ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'RotatingFileHandler', 'namespace' => 'DLMonolog\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => decalog_esc_html__( 'Rotating files', 'decalog' ), 'help' => decalog_esc_html__( 'Events sent to files that are rotated every day and a limited number of files are kept.', 'decalog' ), 'icon' => $this->get_base64_rotatingfiles_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'filename' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'File', 'decalog' ), 'help' => decalog_esc_html__( 'The full absolute path and filename, like "/path/to/file".', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'maxfiles' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Maximum', 'decalog' ), 'help' => decalog_esc_html__( 'The maximal number of files to keep (0 means unlimited).', 'decalog' ), 'default' => 60, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 0, 'max' => 730, 'step' => 1, 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'filename', ], [ 'type' => 'configuration', 'value' => 'maxfiles', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'literal', 'value' => 0666, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'SematextHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Sematext', 'help' => decalog_esc_html__( 'Events sent to Sematext using Elasticsearch APIs.', 'decalog' ), 'icon' => $this->get_base64_sematext_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Location', 'decalog' ), 'help' => decalog_esc_html__( 'The Sematext cloud location.', 'decalog' ), 'default' => 'logsene-receiver.sematext.com', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'logsene-receiver.sematext.com', decalog_esc_html__( 'North America', 'decalog' ) ], [ 'logsene-receiver.eu.sematext.com', decalog_esc_html__( 'Europe', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Application Token', 'decalog' ), 'help' => decalog_esc_html__( 'The "Logs App Token" set in Sematext.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'extended' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Extended fields', 'decalog' ), 'help' => decalog_esc_html__( 'Fields to add to each logged event (one pair of key=value per line).', 'decalog' ) . '
' . decalog_esc_html__( 'Example:', 'decalog' ) . ' hostname={HOSTNAME} ' . decalog_esc_html__( 'or', 'decalog' ) . ' foo=bar ' . decalog_esc_html__( 'or', 'decalog' ) . ' foobar=42.' . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_textarea', 'cast' => 'string', 'enabled' => true, 'columns' => 50, 'lines' => 5, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'extendee', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'StackdriverHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Google Cloud Logging', 'help' => decalog_esc_html__( 'Events sent to Google Cloud Logging via a Google-Fluentd collector.', 'decalog' ), 'icon' => $this->get_base64_stackdriver_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Connection string', 'decalog' ), 'help' => decalog_esc_html__( 'Connection string to Fluentd. Can be something like "tcp://127.0.0.1:24224" or something like "unix:///var/run/td-agent/td-agent.sock".', 'decalog' ) . $this->get_substitution_note(), 'default' => 'tcp://localhost:24224', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'timeout' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Socket timeout', 'decalog' ), 'help' => decalog_esc_html__( 'Max number of milliseconds to wait for the socket.', 'decalog' ), 'default' => 800, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 100, 'max' => 10000, 'step' => 100, 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'timeout', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'SumoSysHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Sumo Logic cloud-syslog', 'help' => decalog_esc_html__( 'Events sent to a Sumo Logic cloud-syslog source.', 'decalog' ), 'icon' => $this->get_base64_sumosys_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Region', 'decalog' ), 'help' => decalog_esc_html__( 'The deployment region of the cloud-syslog endpoint.', 'decalog' ), 'default' => 'syslog.collection.eu.sumologic.com', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => true, 'list' => [ [ 'syslog.collection.au.sumologic.com', decalog_esc_html__( 'Australia', 'decalog' ) ], [ 'syslog.collection.ca.sumologic.com', decalog_esc_html__( 'Canada', 'decalog' ) ], [ 'syslog.collection.de.sumologic.com', decalog_esc_html__( 'Germany', 'decalog' ) ], [ 'syslog.collection.eu.sumologic.com', decalog_esc_html__( 'Europe', 'decalog' ) ], [ 'syslog.collection.jp.sumologic.com', decalog_esc_html__( 'Japan', 'decalog' ) ], [ 'syslog.collection.us1.sumologic.com', decalog_esc_html__( 'United States 1', 'decalog' ) ], [ 'syslog.collection.us2.sumologic.com', decalog_esc_html__( 'United States 2', 'decalog' ) ] ], ], ], 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Source token', 'decalog' ), 'help' => decalog_esc_html__( 'The token of cloud-syslog source.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'proto' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Protocol', 'decalog' ), 'help' => decalog_esc_html__( 'The used cloud-syslog protocol.', 'decalog' ), 'default' => 'TCP', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => false, ], ], 'port' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Port', 'decalog' ), 'help' => decalog_esc_html__( 'The opened port on remote host to receive cloud-syslog messages.', 'decalog' ), 'default' => 6514, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 1, 'max' => 64738, 'step' => 1, 'enabled' => false, ], ], 'timeout' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Socket timeout', 'decalog' ), 'help' => decalog_esc_html__( 'Max number of milliseconds to wait for the socket.', 'decalog' ), 'default' => 800, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 100, 'max' => 10000, 'step' => 100, 'enabled' => true, ], ], 'facility' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Facility', 'decalog' ), 'help' => decalog_esc_html__( 'The cloud-syslog facility for messages sent by DecaLog.', 'decalog' ), 'default' => 'LOG_USER', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => false, ], ], 'ident' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Identifier', 'decalog' ), 'help' => decalog_esc_html__( 'The program identifier for messages sent by DecaLog.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'DecaLog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Message format', 'decalog' ), 'help' => decalog_esc_html__( 'The syslog format standard to use.', 'decalog' ), 'default' => 1, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 0, 'BSD (RFC 3164)' ], [ 1, 'IETF (RFC 5424)' ], [ 2, 'IETF extended (RFC 5424)' ] ], ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'port', ], [ 'type' => 'configuration', 'value' => 'timeout', ], [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'literal', 'value' => 8, ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'configuration', 'value' => 'ident', ], [ 'type' => 'configuration', 'value' => 'format', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'SyslogUdpHandler', 'namespace' => 'DLMonolog\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => 'Syslog', 'help' => decalog_esc_html__( 'Events sent to a remote syslogd server.', 'decalog' ), 'icon' => $this->get_base64_syslog_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Host', 'decalog' ), 'help' => decalog_esc_html__( 'The remote host receiving syslog messages.', 'decalog' ) . $this->get_substitution_note(), 'default' => '127.0.0.1', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'proto' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Protocol', 'decalog' ), 'help' => decalog_esc_html__( 'The used syslog protocol.', 'decalog' ), 'default' => 'UDP', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => false, ], ], 'port' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Port', 'decalog' ), 'help' => decalog_esc_html__( 'The opened port on remote host to receive syslog messages.', 'decalog' ), 'default' => 514, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 1, 'max' => 64738, 'step' => 1, 'enabled' => true, ], ], 'facility' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Facility', 'decalog' ), 'help' => decalog_esc_html__( 'The syslog facility for messages sent by DecaLog.', 'decalog' ), 'default' => 'LOG_USER', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => false, ], ], 'ident' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Identifier', 'decalog' ), 'help' => decalog_esc_html__( 'The program identifier for messages sent by DecaLog.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'DecaLog', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Message format', 'decalog' ), 'help' => decalog_esc_html__( 'The syslog format standard to use.', 'decalog' ), 'default' => 1, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 0, 'BSD (RFC 3164)' ], [ 1, 'IETF (RFC 5424)' ], [ 2, 'IETF extended (RFC 5424)' ] ], ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'port', ], [ 'type' => 'literal', 'value' => 8, ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'configuration', 'value' => 'ident', ], [ 'type' => 'configuration', 'value' => 'format', ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'WordpressHandler', 'namespace' => 'Decalog\Handler', 'class' => 'logging', 'minimal' => Logger::DEBUG, 'name' => decalog_esc_html__( 'WordPress events log', 'decalog' ), 'help' => decalog_esc_html__( 'Events stored in WordPress and available right in your admin dashboard.', 'decalog' ), 'icon' => $this->get_base64_wordpress_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'included' => [ 'WordpressProcessor', 'WWWProcessor', 'IntrospectionProcessor' ], ], 'configuration' => [ 'constant-storage' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Storage', 'decalog' ), 'help' => decalog_esc_html__( 'Place where to store events.', 'decalog' ) . '
' . decalog_esc_html__( 'Note: it\'s not possible to change storage type after logger creation.', 'decalog' ), 'default' => 'db', 'control' => [ 'type' => 'field_select', 'cast' => 'string', 'enabled' => Cache::$apcu_available, 'list' => [ [ 'db', decalog_esc_html__( 'Database: persistent after a server restart', 'decalog' ) ], [ 'apcu', decalog_esc_html__( 'APCu: high performance but reset after each server reboot', 'decalog' ), Cache::$apcu_available ] ], ], ], 'rotate' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Events', 'decalog' ), 'help' => decalog_esc_html__( 'Maximum number of events stored in this events log (0 for no limit).', 'decalog' ), 'default' => 10000, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 0, 'max' => 10000000, 'step' => 1000, 'enabled' => true, ], ], 'purge' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Days', 'decalog' ), 'help' => decalog_esc_html__( 'Maximum age of events stored in this events log (0 for no limit).', 'decalog' ), 'default' => 15, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 0, 'max' => 730, 'step' => 1, 'enabled' => true, ], ], 'local' => [ 'type' => 'boolean', 'show' => is_multisite(), 'name' => decalog_esc_html__( 'Multisite partitioning', 'decalog' ), 'help' => decalog_esc_html__( 'Local administrators can view events that relate to their site.', 'decalog' ), 'default' => false, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'compute', 'value' => 'tablename', ], [ 'type' => 'configuration', 'value' => 'constant-storage', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; // DEBUGGING $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'SpatierayHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'debugging', 'minimal' => Logger::DEBUG, 'name' => 'Spatie Ray', 'help' => decalog_esc_html__( 'Events sent to Ray application.', 'decalog' ), 'icon' => $this->get_base64_spatieray_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [ 'host' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Host', 'decalog' ), 'help' => decalog_esc_html__( 'The host receiving messages.', 'decalog' ) . $this->get_substitution_note(), 'default' => 'localhost', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'port' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Port', 'decalog' ), 'help' => decalog_esc_html__( 'The opened port to receive messages.', 'decalog' ), 'default' => 23517, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 1, 'max' => 64738, 'step' => 1, 'enabled' => true, ], ], 'format' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Format', 'decalog' ), 'help' => decalog_esc_html__( 'The entry format to use.', 'decalog' ), 'default' => 0, 'control' => [ 'type' => 'field_select', 'cast' => 'integer', 'enabled' => true, 'list' => [ [ 0, decalog_esc_html__( 'Summary', 'decalog' ) ], [ 1, decalog_esc_html__( 'Full', 'decalog' ) ] ], ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'host', ], [ 'type' => 'configuration', 'value' => 'port', ], [ 'type' => 'configuration', 'value' => 'format', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'TracyHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'debugging', 'minimal' => Logger::DEBUG, 'name' => 'Tracy', 'help' => decalog_esc_html__( 'Events sent to the Tracy bar, right in the browser.', 'decalog' ), 'icon' => $this->get_base64_tracy_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [], 'configuration' => [], 'init' => [ [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'BrowserConsoleHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'debugging', 'minimal' => Logger::DEBUG, 'name' => decalog_esc_html__( 'Browser console', 'decalog' ), 'help' => decalog_esc_html__( 'Events sent to browser\'s javascript console with no browser extension required.', 'decalog' ), 'icon' => $this->get_base64_browserconsole_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [], 'init' => [ [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'ChromePHPHandler', 'namespace' => 'DLMonolog\\Handler', 'class' => 'debugging', 'minimal' => Logger::DEBUG, 'name' => 'ChromePHP', 'help' => decalog_esc_html__( 'Events sent to the ChromePHP extension (http://www.chromephp.com/).', 'decalog' ), 'icon' => $this->get_base64_chrome_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [], 'init' => [ [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; // ALERTING $this->handlers[] = [ 'version' => DECALOG_MONOLOG_VERSION, 'id' => 'SlackWebhookHandler', 'namespace' => 'DLMonolog\Handler', 'class' => 'alerting', 'minimal' => Logger::WARNING, 'name' => 'Slack', 'help' => decalog_esc_html__( 'Event alerts sent through Slack Webhooks.', 'decalog' ), 'icon' => $this->get_base64_slack_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'excluded' => [ 'BacktraceProcessor' ], ], 'configuration' => [ 'webhook' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Webhook URL', 'decalog' ), 'help' => decalog_esc_html__( 'The Webhook URL set in the Slack application.', 'decalog' ), 'default' => 'https://hooks.slack.com/services/...', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'short' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Short attachment', 'decalog' ), 'help' => decalog_esc_html__( 'Use a shortened version for attachments sent in channel.', 'decalog' ), 'default' => false, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], 'data' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Full data', 'decalog' ), 'help' => decalog_esc_html__( 'Whether the attachments should include context and extra data.', 'decalog' ), 'default' => true, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'webhook', ], [ 'type' => 'literal', 'value' => null, ], [ 'type' => 'literal', 'value' => null, ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'literal', 'value' => null, ], [ 'type' => 'configuration', 'value' => 'short', ], [ 'type' => 'configuration', 'value' => 'data', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'MailHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'alerting', 'minimal' => Logger::WARNING, 'name' => decalog_esc_html__( 'Mail', 'decalog' ), 'help' => decalog_esc_html__( 'Event alerts sent by WordPress via mail.', 'decalog' ), 'icon' => $this->get_base64_mail_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'recipients' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Recipients', 'decalog' ), 'help' => decalog_esc_html__( 'The recipients mail address, in coma separated list.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'recipients', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ]; /*$this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'PagerDuty', 'namespace' => 'Decalog\\Handler', 'class' => 'alerting', 'minimal' => Logger::ERROR, 'name' => decalog_esc_html__( 'PagerDuty', 'decalog' ), 'help' => decalog_esc_html__( 'Event alerts triggered in PagerDuty.', 'decalog' ), 'icon' => $this->get_base64_pagerduty_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'recipients' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Recipients', 'decalog' ), 'help' => decalog_esc_html__( 'The recipients mail address, in coma separated list.', 'decalog' ), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'recipients', ], [ 'type' => 'level' ], [ 'type' => 'literal', 'value' => true, ], ], ];*/ $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'PshHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'alerting', 'minimal' => Logger::WARNING, 'name' => 'Pushover', 'help' => decalog_esc_html__( 'Event alerts sent via Pushover service.', 'decalog' ), 'icon' => $this->get_base64_pushover_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'configuration' => [ 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Application token', 'decalog' ), 'help' => decalog_esc_html__( 'The token of the Pushover application.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'users' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Recipient', 'decalog' ), 'help' => decalog_esc_html__( 'The recipient key. It can be a "user key" or a "group key".', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'title' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Message title', 'decalog' ), 'help' => decalog_esc_html__( 'The title of the message which will be sent.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'timeout' => [ 'type' => 'integer', 'show' => true, 'name' => decalog_esc_html__( 'Socket timeout', 'decalog' ), 'help' => decalog_esc_html__( 'Max number of milliseconds to wait for the socket.', 'decalog' ), 'default' => 800, 'control' => [ 'type' => 'field_input_integer', 'cast' => 'integer', 'min' => 100, 'max' => 10000, 'step' => 100, 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'configuration', 'value' => 'users', ], [ 'type' => 'configuration', 'value' => 'title', ], [ 'type' => 'configuration', 'value' => 'timeout', ], [ 'type' => 'level' ], ], ]; // ANALYTICS $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'BugsnagHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'analytics', 'minimal' => Logger::WARNING, 'name' => 'Bugsnag', 'help' => decalog_esc_html__( 'Crash reports sent to Bugsnag service.', 'decalog' ), 'icon' => $this->get_base64_bugsnag_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'included' => [ 'WordpressProcessor', 'WWWProcessor', 'IntrospectionProcessor' ], 'excluded' => [ 'BacktraceProcessor' ], ], 'configuration' => [ 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'API key', 'decalog' ), 'help' => decalog_esc_html__( 'The API key of the service.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'buffer' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Deferred forwarding', 'decalog' ), 'help' => decalog_esc_html__( 'Wait for the full page is rendered before sending reports (recommended).', 'decalog' ), 'default' => true, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'GAnalyticsHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'analytics', 'minimal' => Logger::WARNING, 'name' => 'Google Universal Analytics', 'help' => decalog_esc_html__( 'Exceptions sent to Google Universal Analytics service.', 'decalog' ), 'icon' => $this->get_base64_ganalytics_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'included' => [ 'WordpressProcessor', 'WWWProcessor' ], 'excluded' => [ 'BacktraceProcessor', 'IntrospectionProcessor' ], ], 'configuration' => [ 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'Tracking ID', 'decalog' ), 'help' => decalog_esc_html__( 'The tracking ID / web property ID for Google Universal Analytics service. The format must be UA-XXXX-Y.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'buffer' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Deferred forwarding', 'decalog' ), 'help' => decalog_esc_html__( 'Wait for the full page is rendered before sending exceptions (recommended).', 'decalog' ), 'default' => true, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'level' ], ], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'RaygunHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'analytics', 'minimal' => Logger::WARNING, 'name' => 'Raygun', 'help' => decalog_esc_html__( 'Crash reports sent to Raygun service.', 'decalog' ), 'icon' => $this->get_base64_raygun_icon(), 'needs' => [], 'params' => [ 'processors', 'privacy' ], 'processors' => [ 'included' => [ 'WordpressProcessor', 'WWWProcessor', 'IntrospectionProcessor' ], 'excluded' => [ 'BacktraceProcessor' ], ], 'configuration' => [ 'token' => [ 'type' => 'string', 'show' => true, 'name' => decalog_esc_html__( 'API key', 'decalog' ), 'help' => decalog_esc_html__( 'The API key of the service.', 'decalog' ) . $this->get_substitution_note(), 'default' => '', 'control' => [ 'type' => 'field_input_text', 'cast' => 'string', 'enabled' => true, ], ], 'buffer' => [ 'type' => 'boolean', 'show' => true, 'name' => decalog_esc_html__( 'Deferred forwarding', 'decalog' ), 'help' => decalog_esc_html__( 'Wait for the full page is rendered before sending reports (recommended).', 'decalog' ), 'default' => true, 'control' => [ 'type' => 'field_checkbox', 'cast' => 'boolean', 'enabled' => true, ], ], ], 'init' => [ [ 'type' => 'configuration', 'value' => 'token', ], [ 'type' => 'literal', 'value' => true, ], [ 'type' => 'level' ], ], ]; // SYSTEM $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'NullHandler', 'namespace' => 'DLMonolog\Handler', 'class' => 'system', 'minimal' => Logger::DEBUG, 'name' => decalog_esc_html__( 'Blackhole', 'decalog' ), 'help' => decalog_esc_html__( 'Any event it can handle will be thrown away.', 'decalog' ), 'icon' => $this->get_base64_php_icon(), 'needs' => [], 'params' => [], 'configuration' => [], 'init' => [], ]; $this->handlers[] = [ 'version' => DECALOG_VERSION, 'id' => 'SharedMemoryHandler', 'namespace' => 'Decalog\\Handler', 'class' => 'system', 'minimal' => Logger::INFO, 'name' => decalog_esc_html__( 'Shared memory', 'decalog' ), 'help' => decalog_esc_html__( 'Automatic events log, stored in server shared memory.', 'decalog' ), 'icon' => $this->get_base64_ram_icon(), 'needs' => [ 'option' => [ 'livelog' ], 'function_exists' => [ 'shmop_open', 'shmop_read', 'shmop_write', 'shmop_delete' ], ], 'params' => [], 'configuration' => [], 'init' => [], ]; uasort( $this->handlers, function ( $a, $b ) { return strcmp( strtolower( $a['name'] ), strtolower( $b['name'] ) ); } ); } /** * Get the string for substitution note. * * @return string The string to add. * @since 3.9.0 */ private function get_substitution_note() { if ( ! Option::network_get( 'env_substitution' ) ) { return ''; } return '
ⓘ ' . decalog_esc_html__( 'This field is eligible to environment variable and PHP-defined constant substitution.', 'decalog' ) . ''; } /** * Get the types definition. * * @return array A list of all available types definitions. * @since 1.0.0 */ public function get_all() { return $this->handlers; } /** * Get the name for a specific class. * * @param string $class The class of loggers ( 'alerting', 'debugging', 'logging'). * @return string The name of the class. * @since 3.0.0 */ public function get_class_name( $class ) { $result = '-'; if ( array_key_exists( $class, $this->handlers_class ) ) { $result = $this->handlers_class[ $class ]; } return $result; } /** * Get the types definition for a specific class. * * @param string $class The class of loggers ( 'alerting', 'debugging', 'logging'). * @return array A list of all available types definitions. * @since 1.2.0 */ public function get_for_class( $class ) { $result = []; foreach ( $this->handlers as $handler ) { if ( $handler['class'] === $class ) { $result[] = $handler; } } usort( $result, function( $a, $b ) { return strcmp( strtolower( $a['name'] ), strtolower( $b['name'] ) ); } ); return $result; } /** * Get the types list. * * @return array A list of all available types. * @since 1.0.0 */ public function get_list() { $result = []; foreach ( $this->handlers as $handler ) { $result[] = $handler['id']; } return $result; } /** * Get a specific handler. * * @param string $id The handler id. * @return null|array The detail of the handler, null if not found. * @since 1.0.0 */ public function get( $id ) { foreach ( $this->handlers as $handler ) { if ( $handler['id'] === $id ) { return $handler; } } return null; } /** * Returns a base64 svg resource for the mail icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_mail_icon( $color = '#0073AA' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the PagerDuty icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_pagerduty_icon( $color = '#06AC38' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the PHP icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_php_icon( $color = '#777BB3' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the RAM icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_ram_icon( $color = '#808080' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the WordPress icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_wordpress_icon( $color = '#0073AA' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the WordPress icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_browserconsole_icon( $color = '#444466' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Chrome icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @param string $color3 Optional. Color 3 of the icon. * @param string $color4 Optional. Color 4 of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_chrome_icon( $color1 = '#EA4335', $color2 = '#4285F4', $color3 = '#34A853', $color4 = '#FBBC05' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the SysLog icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_syslog_icon( $color = '#983256' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the files icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_rotatingfiles_icon( $color = '#FF9920' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Bugsnag icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_bugsnag_icon( $color = '#000D47' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Sentry icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_sentry_icon( $color = '#362d59' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Raygun icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @param string $color3 Optional. Color 3 of the icon. * @param string $color4 Optional. Color 4 of the icon. * @param string $color5 Optional. Color 5 of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_raygun_icon( $color1 = '#F4DB12', $color2 = '#DF282B', $color3 = '#D3D2D3', $color4 = '#C02123', $color5 = '#FFFFFF' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Raygun icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_ganalytics_icon( $color1 = '#F9AB00', $color2 = '#E37400' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Chrome icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @param string $color3 Optional. Color 3 of the icon. * @param string $color4 Optional. Color 4 of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_slack_icon( $color1 = '#36c5f0', $color2 = '#2eb67d', $color3 = '#ecb22e', $color4 = '#e01e5a' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Chrome icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_stackdriver_icon( $color1 = '#FFFFFF', $color2 = '#4386FA' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Pushover icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_pushover_icon( $color = '#249DF1' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Fluentd icon. * * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_fluentd_icon() { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Logentrie icon. * * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_logentries_icon() { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Loggly icon. * * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_loggly_icon() { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Sematext icon. * * @param string $color Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_sematext_icon( $color = '#1fa0ed' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Elastic Cloud icon. * * @param string $color1 Optional. Color of the icon. * @param string $color2 Optional. Color of the icon. * @param string $color3 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_elasticcloud_icon( $color1 = '#00BFB3', $color2 = '#0077CC', $color3 = '#343741' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Elasticsearch icon. * * @param string $color1 Optional. Color of the icon. * @param string $color2 Optional. Color of the icon. * @param string $color3 Optional. Color of the icon. * @param string $color4 Optional. Color of the icon. * @param string $color5 Optional. Color of the icon. * @param string $color6 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 2.4.0 */ private function get_base64_elasticsearch_icon( $color1 = '#f0bf1a', $color2 = '#3ebeb0', $color3 = '#07a5de', $color4 = '#231f20', $color5 = '#d7a229', $color6 = '#019b8f' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Sumo icon. * * @param string $color1 Optional. Color of the icon. * @param string $color2 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 1.0.0 */ private function get_base64_sumosys_icon( $color1 = '#000099', $color2 = '#FEFEFE' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Sematext icon. * * @param string $color1 Optional. Color of the icon. * @param string $color2 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 2.4.0 */ private function get_base64_loki_icon( $color1 = '#F9EC1C', $color2 = '#F05A2B' ) { $style = ''; for ( $i = 1; $i < 16; $i++ ) { $style .= ' .st' . $i . '{fill:url(#SVGID_' . $i . '_);}'; } $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Grafana icon. * * @param string $color1 Optional. Color of the icon. * @param string $color2 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 2.4.0 */ private function get_base64_grafana_icon( $color1 = '#FFF100', $color2 = '#F05A28' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Prometheus icon. * * @param string $color1 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 3.0.0 */ private function get_base64_prometheus_icon( $color1 = '#DA4E31' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the influxDB icon. * * @param string $color1 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 3.0.0 */ private function get_base64_infuxdb_icon( $color1 = '#22ADF6' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Tempo icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @return string The svg resource as a base64. * @since 3.0.0 */ private function get_base64_tempo_icon( $color1 = '#fff100', $color2 = '#f05a28' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Zipkin icon. * * @param string $color1 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 3.0.0 */ private function get_base64_zipkin_icon( $color1 = '#EC7849' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Jaeger icon. * * @param string $color1 Optional. Color of the icon. * @param string $color2 Optional. Color of the icon. * @param string $color3 Optional. Color of the icon. * @param string $color4 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 3.0.0 */ private function get_base64_jaeger_icon( $color1 = '#231f20', $color2 = '#67cfe3', $color3 = '#dfcaa3', $color4 = '#648c1a' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Zipkin icon. * * @param string $color1 Optional. Color of the icon. * @return string The svg resource as a base64. * @since 3.0.0 */ private function get_base64_datadog_icon( $color1 = '#632CA6' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the New Relic icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @return string The svg resource as a base64. * @since 3.2.0 */ private function get_base64_newrelic_icon( $color1 = '#008c99', $color2 = '#70ccd3' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Tracy icon. * * @param string $color1 Optional. Color 1 of the icon. * @param string $color2 Optional. Color 2 of the icon. * @return string The svg resource as a base64. * @since 3.2.0 */ private function get_base64_tracy_icon( $color1 = '#cc1817', $color2 = '#ebacac', $color3 = '#fbfaf9', $color4 = '#5fade9', $color5 = '#9da09f', $color6 = '#faf4ce' ) { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } /** * Returns a base64 svg resource for the Zipkin icon. * * @return string The svg resource as a base64. * @since 3.4.0 */ private function get_base64_spatieray_icon() { $source = ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; $source .= ''; // phpcs:ignore return 'data:image/svg+xml;base64,' . base64_encode( $source ); } }