2017 © Pedro Peláez
 

library maxbanton-cwh

AWS CloudWatch Handler for Monolog library

image

felixmaier1989/maxbanton-cwh

AWS CloudWatch Handler for Monolog library

  • Tuesday, October 17, 2017
  • by felixmaier1989
  • Repository
  • 1 Watchers
  • 1 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 27 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

AWS CloudWatch Logs Handler for Monolog

Build Status Coverage Status License Version Downloads, (*1)

Handler for PHP logging library Monolog for sending log entries to AWS CloudWatch Logs service., (*2)

Before using this library, it's recommended to get acquainted with the pricing for AWS CloudWatch services., (*3)

Please press ★ Star button if you find this library useful, aslo you can donate if you like to., (*4)

Features

  • Up to 10000 batch logs sending in order to avoid Rate exceeded errors
  • Log Groups creating with tags
  • AWS CloudWatch Logs staff lazy loading
  • Suitable for web applications and for long-living CLI daemons and workers
  • Compatible with PHP 5.6 / 7.0 / 7.1

Installation

Install the latest version with Composer, (*5)

$ composer require maxbanton/cwh:^1.0

Upgrade

Change in your composer.json, (*6)

{
  "require": {
    "maxbanton/cwh": "^0.0.3"
  }
}

to, (*7)

{
  "require": {
    "maxbanton/cwh": "^1.0"
  }
}

then run, (*8)

$ composer update

and change your code, (*9)

<?php
// Instantiate handler
$handler = new CloudWatch($client, $logGroupName, $logStreamName, $daysToRetention);

to, (*10)

<?php
// Instantiate handler (tags are optional)
$handler = new CloudWatch($client, $groupName, $streamName, $retentionDays, 10000, ['my-awesome-tag' => 'tag-value']);

Basic Usage

<?php

use Aws\CloudWatchLogs\CloudWatchLogsClient;
use Maxbanton\Cwh\Handler\CloudWatch;
use Monolog\Logger;

$sdkParams = [
    'region' => 'eu-west-1',
    'version' => 'latest',
    'credentials' => [
        'key' => 'your AWS key',
        'secret' => 'your AWS secret',
        'token' => 'your AWS session token', // token is optional
    ]
];

// Instantiate AWS SDK CloudWatch Logs Client
$client = new CloudWatchLogsClient($sdkParams);

// Log group name, will be created if none
$groupName = 'php-logtest';

// Log stream name, will be created if none
$streamName = 'ec2-instance-1';

// Days to keep logs, 14 by default
$retentionDays = 30;

// Instantiate handler (tags are optional)
$handler = new CloudWatch($client, $groupName, $streamName, $retentionDays, 10000, ['my-awesome-tag' => 'tag-value']);

// Create a log channel
$log = new Logger('name');

// Set handler
$log->pushHandler($handler);

// Add records to the log
$log->debug('Foo');
$log->warning('Bar');
$log->error('Baz');

Frameworks integration

Issues

Feel free to report any issues, (*13)

Contributing

Please check this document, (*14)

If you would like to, you can send any amount of BTC to the wallet 12d3VXfvPiQ5bFMfPppGqpwnNSkZwigBVt, (*15)

The Versions

17/10 2017

dev-master

9999999-dev

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

17/10 2017

v1.1.32

1.1.32.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

17/10 2017

v1.1.31

1.1.31.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

02/10 2017

v1.1.3

1.1.3.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

02/09 2017

v1.1.2

1.1.2.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

31/08 2017

v1.1.1

1.1.1.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

31/08 2017

v1.1

1.1.0.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

04/03 2017

v1.0

1.0.0.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

22/11 2016

v0.3

0.3.0.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

09/11 2016

v0.2

0.2.0.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

29/08 2016

v0.1.1

0.1.1.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch

03/07 2016

v0.1

0.1.0.0

AWS CloudWatch Handler for Monolog library

  Sources   Download

MIT

The Requires

 

The Development Requires

monolog aws cloudwatch