|
1 | 1 | ## Logger for Aws Cloud Watch |
2 | 2 |
|
| 3 | +### Breaking Change for version 1.0 |
| 4 | + |
| 5 | +When this package started it started as a listener for log event and would only work with another driver. |
| 6 | +This package would listen to log events and just log extra to cloud watch but after `1.0` it works as a custom driver. |
| 7 | +So, you MUST add a `LOG_CHANNEL` for logging in your config for this to work. |
| 8 | + |
3 | 9 | ### Installation |
4 | 10 |
|
5 | 11 | `composer require pagevamp/laravel-cloudwatch-logs` |
@@ -28,34 +34,16 @@ Config for logging is defined at `config/logging.php`. Add `cloudwatch` to the ` |
28 | 34 | 'retention' => env('CLOUDWATCH_LOG_RETENTION_DAYS', 14), |
29 | 35 | 'group_name' => env('CLOUDWATCH_LOG_GROUP_NAME', 'laravel_app'), |
30 | 36 | 'version' => env('CLOUDWATCH_LOG_VERSION', 'latest'), |
31 | | - 'formatter' => \Monolog\Formatter\JsonFormatter::class, |
32 | | - 'disabled' => env('DISABLE_CLOUDWATCH_LOG', false), |
| 37 | + 'formatter' => \Monolog\Formatter\JsonFormatter::class, |
| 38 | + 'via' => \Pagevamp\Logger::class, |
33 | 39 | ], |
34 | 40 | ] |
35 | 41 | ``` |
36 | 42 |
|
37 | | -Add correct values to keys in your `.env` file. And it should work. |
| 43 | +And set the log channel in your environment variable to `LOG_CHANNEL` to `cloudwatch`. |
38 | 44 |
|
39 | 45 | If the role of your AWS EC2 instance has access to Cloudwatch logs, `CLOUDWATCH_LOG_KEY` and `CLOUDWATCH_LOG_SECRET` need not be defined in your `.env` file. |
40 | 46 |
|
41 | | -### Add To Project |
42 | | - |
43 | | -#### Laravel 5.5 or Higher |
44 | | - |
45 | | -This package uses laravel's [Package discovery](https://laravel.com/docs/5.6/packages#package-discovery). To disable this package by default you can add `DISABLE_CLOUDWATCH_LOG=true` to you local `.env` file and this package will be disabled. |
46 | | - |
47 | | -#### Laravel 5.4 or Lower |
48 | | - |
49 | | -Add to the `providers` array in `config/app.php`: |
50 | | - |
51 | | -``` |
52 | | -Pagevamp\Providers\CloudWatchServiceProvider::class |
53 | | -``` |
54 | | - |
55 | | -### Concept |
56 | | - |
57 | | -This package relies on laravel's listener for log events. This package DOES NOT replace the default logging, instead adds additional log to AWS CLoud Watch. Hence you do not have to change the default log driver to make this work. |
58 | | - |
59 | 47 | ### Contribution |
60 | 48 |
|
61 | 49 | I have added a `pre-commit` hook to run `php-cs-fixer` whenever you make a commit. To enable this run `sh hooks.sh`. |
|
0 commit comments