maxbanton / cwh

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

No apply retention days #66

Closed omacesc closed 4 years ago

omacesc commented 5 years ago
$cwClient = App::make('aws')->createClient('CloudWatchLogs');
$cwGroupName = config('laravel-monolog-ext.drivers.cloudwatch.group');
$cwStreamNameApp = 'laravel-' . now()->toDateString() . '.log';
$cwRetentionDays = config('laravel-monolog-ext.drivers.cloudwatch.retention');
$cwLevel = config('laravel-monolog-ext.drivers.cloudwatch.level');
$this->cwHandlerApp = new CloudWatch($cwClient, $cwGroupName, $cwStreamNameApp, $cwRetentionDays, 10000, [], $cwLevel);
$monolog->pushHandler($this->cwHandlerApp);

The user AWS have full access in CloudWatch Logs

I checked in code, and enter in this part:

if ($this->retention !== null) {
                $this
                    ->client
                    ->putRetentionPolicy(
                        [
                            'logGroupName' => $this->group,
                            'retentionInDays' => $this->retention,
                        ]
                    );
            }

But in AWS CloudWatch, didn't change, always put never expire Thanks for your support!