cwh icon indicating copy to clipboard operation
cwh copied to clipboard

#116 monolog update

Open tanerincode opened this issue 1 year ago • 6 comments

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) https://github.com/maxbanton/cwh/issues/116

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Monologue has made a significant change, it now accepts LogRecords instead of arrays. This PR contains minor changes for the given situation.

  • Other information:
        $config = [
            "group_name" => "my_group_name",
            "stream_name" => "my_stream_name",
            "retention" => 30,
            "sdk" => [
                  'region' => 'eu-east-1',
                  'version' => 'latest',
                  'credentials' => [
                      'key' => getenv('AWS_CLOUDWATCH_KEY'),
                      'secret' => getenv('AWS_CLOUDWATCH_SECRET')
                  ]
            ]
        ];

      $client = new CloudWatchLogsClient($config["sdk"]);

       $handler = new CloudWatch(
            client: $client,
            group: $config["group_name"],
            stream: $config["stream_name"],
            retention: $config["retention"],
            batchSize: 10000,
            tags: [], 
            level: Level::Debug, 
            bubble: true,
            createGroup: false
        );

        $handler->setFormatter(new JsonFormatter());
        $logger = new Logger('here_your_channel_name');
        $logger->pushHandler($handler);

        return $logger;

tanerincode avatar Mar 10 '23 09:03 tanerincode

Great job, tanerincode! I hope Maksym finds time to approve it :)

vnrmc avatar Mar 15 '23 09:03 vnrmc

@maxbanton please approve this PR if it's okay for you

stefanrakicfaxi avatar May 03 '23 13:05 stefanrakicfaxi

I'm switching to another CloudWatch logging provider as this is blocking my upgrade to Laravel 10. I'm sure I'm not alone :disappointed:

ravewill avatar Aug 07 '23 01:08 ravewill

@maxbanton can you please merge this PR and make new release version?

SoCooLoveec avatar Sep 28 '23 08:09 SoCooLoveec

@maxbanton Please, do you have any update to merge this PR?

jandominikair avatar Jan 05 '24 13:01 jandominikair

@jandominikair i think he is not available for review this pr, someone did this package alternative with this fix, you can find that one in pr's or issues

tanerincode avatar Jan 06 '24 12:01 tanerincode