DatadogHandler
extends AbstractProcessingHandler
in package
Sends logs to Datadog Logs using Curl integrations
You'll need a Datzdog account to use this handler.
Tags
Table of Contents
Constants
- DATADOG_LOG_HOST = 'https://http-intake.logs.datadoghq.com'
- Datadog Api Key access
Properties
- $apiKey : string
- Datadog Api Key access
- $attributes : array<string|int, mixed>
- Datadog's optionals attributes
Methods
- __construct() : mixed
- getApiKey() : string
- Get Datadog Api Key from $attributes params.
- getDefaultFormatter() : FormatterInterface
- Returns the default formatter to use with this handler
- getHostname() : string
- Get Datadog Hostname from $attributes params.
- getService() : string
- Get Datadog Service from $attributes params.
- getSource() : string
- Get Datadog Source from $attributes params.
- getTags() : string
- Get Datadog Tags from $attributes params.
- send() : mixed
- Send request to @link https://http-intake.logs.datadoghq.com on send action.
- write() : void
- Handles a log record
Constants
DATADOG_LOG_HOST
Datadog Api Key access
protected
string
DATADOG_LOG_HOST
= 'https://http-intake.logs.datadoghq.com'
Properties
$apiKey
Datadog Api Key access
private
string
$apiKey
$attributes
Datadog's optionals attributes
private
array<string|int, mixed>
$attributes
Methods
__construct()
public
__construct(string $apiKey[, array<string|int, mixed> $attributes = [] ][, int $level = Logger::DEBUG ][, bool $bubble = true ]) : mixed
Parameters
- $apiKey : string
-
Datadog Api Key access
- $attributes : array<string|int, mixed> = []
-
Some options fore Datadog Logs
- $level : int = Logger::DEBUG
-
The minimum logging level at which this handler will be triggered
- $bubble : bool = true
-
Whether the messages that are handled can bubble up the stack or not
Tags
getApiKey()
Get Datadog Api Key from $attributes params.
protected
getApiKey(string $apiKey) : string
Parameters
- $apiKey : string
Tags
Return values
stringgetDefaultFormatter()
Returns the default formatter to use with this handler
protected
getDefaultFormatter() : FormatterInterface
Return values
FormatterInterfacegetHostname()
Get Datadog Hostname from $attributes params.
protected
getHostname() : string
Return values
stringgetService()
Get Datadog Service from $attributes params.
protected
getService(string $record) : string
Parameters
- $record : string
Return values
stringgetSource()
Get Datadog Source from $attributes params.
protected
getSource() : string
Return values
stringgetTags()
Get Datadog Tags from $attributes params.
protected
getTags() : string
Return values
stringsend()
Send request to @link https://http-intake.logs.datadoghq.com on send action.
protected
send(string $record) : mixed
Parameters
- $record : string
write()
Handles a log record
protected
write(array<string|int, mixed> $record) : void
Parameters
- $record : array<string|int, mixed>