Compare commits

..

No commits in common. 'production' and '0.2.2' have entirely different histories.

@ -52,11 +52,11 @@ class DiscordHandler extends AbstractProcessingHandler
{ {
if (is_array($record)) { if (is_array($record)) {
// Implementação para Monolog 1.x // Implementação para Monolog 1.x
$this->recordHandler($record); $this->processRecord($record);
}elseif (class_exists(LogRecord::class) && $record instanceof LogRecord) { }elseif (class_exists(LogRecord::class) && $record instanceof LogRecord) {
// Implementação para Monolog 2.x // Implementação para Monolog 2.x
$arrayRecord = $record->toArray(); $arrayRecord = $record->toArray();
$this->recordHandler($arrayRecord); $this->processRecord($arrayRecord);
} }
} }
@ -65,7 +65,7 @@ class DiscordHandler extends AbstractProcessingHandler
* @return void * @return void
* @throws GuzzleException * @throws GuzzleException
*/ */
protected function recordHandler(array $record) protected function processRecord(array $record)
{ {
if ($this->rateLimitRemaining === 0 && $this->rateLimitReset !== null) { if ($this->rateLimitRemaining === 0 && $this->rateLimitReset !== null) {
$this->waitUntil($this->rateLimitReset); $this->waitUntil($this->rateLimitReset);

@ -61,11 +61,11 @@ class RabbitMQHandler extends AbstractProcessingHandler
{ {
if (is_array($record)) { if (is_array($record)) {
// Implementação para Monolog 1.x // Implementação para Monolog 1.x
$this->recordHandler($record); $this->processRecord($record);
}elseif (class_exists(LogRecord::class) && $record instanceof LogRecord) { }elseif (class_exists(LogRecord::class) && $record instanceof LogRecord) {
// Implementação para Monolog 2.x // Implementação para Monolog 2.x
$arrayRecord = $record->toArray(); $arrayRecord = $record->toArray();
$this->recordHandler($arrayRecord); $this->processRecord($arrayRecord);
} }
} }
@ -73,11 +73,11 @@ class RabbitMQHandler extends AbstractProcessingHandler
* @param array $record * @param array $record
* @return void * @return void
*/ */
protected function recordHandler(array $record) protected function processRecord(array $record)
{ {
$data = json_encode($record); $data = json_encode($record);
$msg = new AMQPMessage($data, [ $msg = new AMQPMessage($data, [
'delivery_mode' => 2 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT
]); ]);
$this->channel->basic_publish($msg, $this->exchange, $this->routingKey); $this->channel->basic_publish($msg, $this->exchange, $this->routingKey);

@ -69,8 +69,6 @@ trait LogTrait
{ {
$this->initializeLogServices(); $this->initializeLogServices();
$customData['server_ip'] = config('laravel-logs-layer.server_ip');
foreach ($this->logServices as $logService) { foreach ($this->logServices as $logService) {
$logService->$method($message, [ $logService->$method($message, [
'custom_data' => $customData, 'custom_data' => $customData,
@ -149,8 +147,6 @@ trait LogTrait
$this->initializeLogServices(); $this->initializeLogServices();
$customData['server_ip'] = config('laravel-logs-layer.server_ip');
foreach ($this->logServices as $logService) { foreach ($this->logServices as $logService) {
$logService->$log_level($caller, $exception, ExceptionContextDTO::fromArray([ $logService->$log_level($caller, $exception, ExceptionContextDTO::fromArray([
'code' => $errorCode, 'code' => $errorCode,

@ -15,5 +15,4 @@ return [
'backoff' => explode(',', env('LOG_QUEUE_BACKOFF', '15')) 'backoff' => explode(',', env('LOG_QUEUE_BACKOFF', '15'))
], ],
'sensitive_data' => env('LOGS_LAYER_SENSITIVE_DATA', 'password,password_confirmation,token,api_token,api_key,access_token,refresh_token,authorization_code,client_secret'), 'sensitive_data' => env('LOGS_LAYER_SENSITIVE_DATA', 'password,password_confirmation,token,api_token,api_key,access_token,refresh_token,authorization_code,client_secret'),
'server_ip' => env('SERVER_IP', '127.0.0.1')
]; ];

Loading…
Cancel
Save