Skip to content

elevantiq/monolog-cloudwatch-bundle

Repository files navigation

Monolog CloudWatch Bundle

This bundle heavily depends on the maxbanton/cwh package. So go to the Github repository and also leave a star.

Prerequisites

This bundle requires Symfony 3.4+.

Installation

Add alpin11/monolog-cloudwatch-bundle to your composer.json file:

php composer.phar require "alpin11/monolog-cloudwatch-bundle"

Register the 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],
];

AWS IAM needed permissions

if you prefer to use a separate programmatic IAM user (recommended) or want to define a policy, make sure following permissions are included:

  1. CreateLogGroup aws docs
  2. CreateLogStream aws docs
  3. PutLogEvents aws docs
  4. PutRetentionPolicy aws docs
  5. DescribeLogStreams aws docs
  6. DescribeLogGroups aws docs

AWS IAM Policy full json example

{
    "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}"
            ]
        }
    ]
}

Issues

Feel free to report any issues

Contributing

Please check this document

Releases

No releases published

Packages

No packages published

Languages