PATH:
home
/
lab2454c
/
vaultchip.com
/
vendor
/
monolog
/
monolog
/
src
/
Monolog
/
Handler
<?php declare(strict_types=1); /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use Aws\Sdk; use Aws\DynamoDb\DynamoDbClient; use Monolog\Formatter\FormatterInterface; use Aws\DynamoDb\Marshaler; use Monolog\Formatter\ScalarFormatter; use Monolog\Logger; /** * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/) * * @link https://github.com/aws/aws-sdk-php/ * @author Andrew Lawson <adlawson@gmail.com> */ class DynamoDbHandler extends AbstractProcessingHandler { public const DATE_FORMAT = 'Y-m-d\TH:i:s.uO'; /** * @var DynamoDbClient */ protected $client; /** * @var string */ protected $table; /** * @var int */ protected $version; /** * @var Marshaler */ protected $marshaler; public function __construct(DynamoDbClient $client, string $table, $level = Logger::DEBUG, bool $bubble = true) { /** @phpstan-ignore-next-line */ if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { $this->version = 3; $this->marshaler = new Marshaler; } else { $this->version = 2; } $this->client = $client; $this->table = $table; parent::__construct($level, $bubble); } /** * {@inheritDoc} */ protected function write(array $record): void { $filtered = $this->filterEmptyFields($record['formatted']); if ($this->version === 3) { $formatted = $this->marshaler->marshalItem($filtered); } else { /** @phpstan-ignore-next-line */ $formatted = $this->client->formatAttributes($filtered); } $this->client->putItem([ 'TableName' => $this->table, 'Item' => $formatted, ]); } /** * @param mixed[] $record * @return mixed[] */ protected function filterEmptyFields(array $record): array { return array_filter($record, function ($value) { return !empty($value) || false === $value || 0 === $value; }); } /** * {@inheritDoc} */ protected function getDefaultFormatter(): FormatterInterface { return new ScalarFormatter(self::DATE_FORMAT); } }
[-] PushoverHandler.php
[edit]
[-] DeduplicationHandler.php
[edit]
[-] FormattableHandlerTrait.php
[edit]
[-] PsrHandler.php
[edit]
[-] NoopHandler.php
[edit]
[-] SendGridHandler.php
[edit]
[-] RotatingFileHandler.php
[edit]
[-] LogglyHandler.php
[edit]
[-] ElasticsearchHandler.php
[edit]
[-] BrowserConsoleHandler.php
[edit]
[-] StreamHandler.php
[edit]
[-] InsightOpsHandler.php
[edit]
[-] SlackWebhookHandler.php
[edit]
[+]
..
[-] FingersCrossedHandler.php
[edit]
[-] TestHandler.php
[edit]
[+]
Slack
[-] FilterHandler.php
[edit]
[-] AbstractProcessingHandler.php
[edit]
[+]
SyslogUdp
[-] MissingExtensionException.php
[edit]
[-] FormattableHandlerInterface.php
[edit]
[-] DynamoDbHandler.php
[edit]
[-] RedisHandler.php
[edit]
[-] ElasticaHandler.php
[edit]
[-] SocketHandler.php
[edit]
[-] CubeHandler.php
[edit]
[-] MandrillHandler.php
[edit]
[-] CouchDBHandler.php
[edit]
[-] AbstractSyslogHandler.php
[edit]
[-] HandlerWrapper.php
[edit]
[-] SqsHandler.php
[edit]
[-] WebRequestRecognizerTrait.php
[edit]
[-] MongoDBHandler.php
[edit]
[-] TelegramBotHandler.php
[edit]
[-] FirePHPHandler.php
[edit]
[-] NullHandler.php
[edit]
[-] SyslogHandler.php
[edit]
[-] LogEntriesHandler.php
[edit]
[-] ProcessableHandlerTrait.php
[edit]
[-] DoctrineCouchDBHandler.php
[edit]
[-] ChromePHPHandler.php
[edit]
[-] ErrorLogHandler.php
[edit]
[-] ProcessHandler.php
[edit]
[-] AmqpHandler.php
[edit]
[-] GelfHandler.php
[edit]
[-] BufferHandler.php
[edit]
[+]
Curl
[-] RollbarHandler.php
[edit]
[-] FleepHookHandler.php
[edit]
[-] SlackHandler.php
[edit]
[-] WhatFailureGroupHandler.php
[edit]
[-] HandlerInterface.php
[edit]
[-] RedisPubSubHandler.php
[edit]
[-] OverflowHandler.php
[edit]
[-] MailHandler.php
[edit]
[-] LogmaticHandler.php
[edit]
[-] GroupHandler.php
[edit]
[-] NewRelicHandler.php
[edit]
[-] IFTTTHandler.php
[edit]
[-] AbstractHandler.php
[edit]
[-] Handler.php
[edit]
[-] NativeMailerHandler.php
[edit]
[-] SamplingHandler.php
[edit]
[-] FlowdockHandler.php
[edit]
[-] ZendMonitorHandler.php
[edit]
[-] FallbackGroupHandler.php
[edit]
[-] SyslogUdpHandler.php
[edit]
[-] ProcessableHandlerInterface.php
[edit]
[+]
FingersCrossed
[-] PHPConsoleHandler.php
[edit]
[-] SwiftMailerHandler.php
[edit]