laravel-cloudwatch-logs
laravel-cloudwatch-logs copied to clipboard
Add config option for $createGroup
Requested feature
Configuration option create_group
Rationale
When the underlying Maxbanton\Cwh\Handler\Cloudwatch instance flushes the logs, it will initialize itself and check if the log group and log stream already exist or create them if they do not.
To prevent this behavior (for example due to limited permissions on AWS), they provide the constructor parameter createGroup which defaults to true -> to source code. It would be beneficial to have this parameter exposed as config option of this log handler so it can be configured on the application level. Currently, the parameter is left unspecified in this library -> to source code
Let me know what you think about this so I might open a pull request in the future.
It is understandable why administrators might be reluctant to allow the logs:DescribeLogGroups since it cannot be scoped to a single resource. An malicious actor who obtained the application's AWS credentials is able to learn the names of all log groups in the account even though actual access to them might be blocked.
I have a problem with this thing too, will be great to that parameter can be moved to config
#38 seems to add this
With #42 that was merged around 3 weeks ago has shifted from using Maxbanton\Cwh\Handler\Cloudwatch to PhpNexus\Cwh\Handler\Cloudwatch package.
The current open PR #38 might be helpful but the new package PhpNexus also supports an additional param $creatStream which is useful to further reduce API calls to AWS in case LogGroup and LogStream both already exist - reference docs
I am looking forward to having this suggestion accepted so that API throttling can be controlled by the application via config params exposed by the library.