maxbanton / cwh

Amazon Web Services CloudWatch Logs Handler for Monolog library
MIT License
417 stars 83 forks source link

[BUG] Cover the case of the AWS Outage #93

Open tuxoff opened 3 years ago

tuxoff commented 3 years ago

Describe the bug We had to experience the problem in terms of the AWS Outage us-east-1 with CloudWatch. https://www.theverge.com/2020/11/25/21719396/amazon-web-services-aws-outage-down-internet

Expected behavior The application should still run even if AWS CloudWatch is not responding.

Please provide the steps to reproduce and if possible a minimal demo of the problem Any instructions on how to reproduce a bug: play locally around the firewall to disable AWS connection and try to run.

Please tell about your environment:

maxjmax commented 1 year ago

The approach I have used for this (which is what laravel also seems to do), is to wrap the handlers in a WhatFailureGroupHandler

    $logger->setHandlers([new WhatFailureGroupHandler($handlers)]);

which will simply ignore any exceptions from handlers, allowing it to fallback to a FileHandler.