This bundle heavily depends on the maxbanton/cwh package. So go to the Github repository and also leave a star.
This bundle requires Symfony 3.4+.
Add alpin11/monolog-cloudwatch-bundle
to your composer.json file:
php composer.phar require "alpin11/monolog-cloudwatch-bundle"
Symfony 3 Version:
Register bundle into app/AppKernel.php:
public function registerBundles()
{
return array(
// ...
new MonologCloudWatch\MonologCloudWatchBundle(),
);
}Symfony 4 Version :
Register bundle into config/bundles.php:
return [
//...
MonologCloudWatch\MonologCloudWatchBundle::class => ['all' => true],
];if you prefer to use a separate programmatic IAM user (recommended) or want to define a policy, make sure following permissions are included:
CreateLogGroupaws docsCreateLogStreamaws docsPutLogEventsaws docsPutRetentionPolicyaws docsDescribeLogStreamsaws docsDescribeLogGroupsaws docs
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "logs:CreateLogGroup",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"logs:DescribeLogGroups",
"logs:CreateLogStream",
"logs:DescribeLogStreams",
"logs:PutRetentionPolicy"
],
"Resource": "{LOG_GROUP_ARN}"
},
{
"Effect": "Allow",
"Action": [
"logs:PutLogEvents"
],
"Resource": [
"{LOG_STREAM_1_ARN}",
"{LOG_STREAM_2_ARN}"
]
}
]
}Feel free to report any issues
Please check this document