@@ -14,9 +14,9 @@ composer require tarfin-labs/laravel-cloudwatch-logger
14
14
15
15
Config parameters for logging are defined at ` config/logging.php ` .
16
16
17
- You need to add new channel as ` cloudwatch ` and copy params inside ` config/config.php ` into it.
17
+ You need to add new channel as ` cloudwatch ` and copy params inside ` config/config.php ` into it.
18
18
19
- ``` php
19
+ ``` php
20
20
'channels' => [
21
21
...
22
22
@@ -36,7 +36,7 @@ You need to add new channel as `cloudwatch` and copy params inside `config/confi
36
36
'stream' => env('CLOUDWATCH_LOG_STREAM', 'default'),
37
37
'retention' => env('CLOUDWATCH_LOG_RETENTION', 7),
38
38
'level' => env('CLOUDWATCH_LOG_LEVEL', 'error'),
39
- 'extra' => [
39
+ 'extra' => [ // In case there's extra information to be logged
40
40
'env' => env('APP_ENV'),
41
41
'php' => PHP_VERSION,
42
42
'laravel' => app()->version(),
@@ -46,22 +46,24 @@ You need to add new channel as `cloudwatch` and copy params inside `config/confi
46
46
```
47
47
48
48
Change the log channel inside ` .env ` file with ` cloudwatch ` .
49
+
49
50
``` dotenv
50
51
LOG_CHANNEL=cloudwatch
51
52
```
52
53
53
54
You can use Laravel's default ` Log ` class to send your logs to CloudWatch.
54
- ```` php
55
+
56
+ ``` php
55
57
\Illuminate\Support\Facades\Log::info('user logged in successfully', [
56
- 'id' => 1,
57
- 'username' => 'JohnDoe',
58
+ 'id' => 1,
59
+ 'username' => 'JohnDoe',
58
60
'ip' => '127.0.0.1',
59
61
]);
60
- ````
62
+ ```
61
63
62
64
### Testing
63
65
64
- ``` bash
66
+ ``` bash
65
67
composer test
66
68
```
67
69
@@ -79,11 +81,11 @@ If you discover any security related issues, please email development@tarfin.com
79
81
80
82
## Credits
81
83
82
- - [ Turan Karatuğ] ( https://github.com/tkaratug )
83
- - [ Faruk Can] ( https://github.com/frkcn )
84
- - [ Yunus Emre Deligöz] ( https://github.com/deligoez )
85
- - [ Hakan Özdemir] ( https://github.com/hozdemir )
86
- - [ All Contributors] ( ../../contributors )
84
+ - [ Turan Karatuğ] ( https://github.com/tkaratug )
85
+ - [ Faruk Can] ( https://github.com/frkcn )
86
+ - [ Yunus Emre Deligöz] ( https://github.com/deligoez )
87
+ - [ Hakan Özdemir] ( https://github.com/hozdemir )
88
+ - [ All Contributors] ( ../../contributors )
87
89
88
90
## License
89
91
0 commit comments