Skip to content

Commit 4fbe8bc

Browse files
committed
Bref v3: enable CloudWatch formatter by default
1 parent 299745b commit 4fbe8bc

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

src/BrefServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Bref\LaravelBridge\Console\Commands\BrefTinkerCommand;
66
use Bref\LaravelBridge\Queue\QueueHandler;
77

8+
use Bref\Monolog\CloudWatchFormatter;
89
use Illuminate\Console\Events\ScheduledTaskStarting;
910

1011
use Illuminate\Log\LogManager;
@@ -168,6 +169,10 @@ protected function fixDefaultConfiguration()
168169
Config::set('logging.default', 'stderr');
169170
}
170171

172+
if (Config::get('logging.channels.stderr.formatter') === null) {
173+
Config::set('logging.channels.stderr.formatter', CloudWatchFormatter::class);
174+
}
175+
171176
if (Config::get('logging.channels.emergency.path') === storage_path('logs/laravel.log')) {
172177
Config::set('logging.channels.emergency', Config::get('logging.channels.stderr'));
173178
}

stubs/serverless.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
service: laravel
22

3-
# Set your team ID if you are using Bref Cloud
3+
# Set your team ID if you are using Bref Cloud (https://bref.sh/cloud)
44
#bref:
55
# team: my-team-id
66

@@ -11,23 +11,13 @@ provider:
1111
# Environment variables
1212
environment:
1313
APP_ENV: production # Or use ${sls:stage} if you want the environment to match the stage
14+
# Replace with a secret variable: https://bref.sh/docs/environment/variables#secrets
15+
APP_KEY: 'base64:aqIOr0nFlPj0RtsUR4MTtIu4EBWohrOr9qcw0xVZE6c='
16+
APP_DEBUG: false
1417
SESSION_DRIVER: cookie # Change to database if you have set up a database
15-
16-
package:
17-
# Files and directories to exclude from deployment
18-
patterns:
19-
- '!node_modules/**'
20-
- '!public/storage'
21-
- '!resources/assets/**'
22-
- '!resources/css/**'
23-
- '!resources/images/**'
24-
- '!resources/js/**'
25-
- '!storage/**'
26-
- '!tests/**'
27-
- '!database/*.sqlite'
28-
# Exclude assets except for the manifest file
29-
- '!public/build/**'
30-
- 'public/build/manifest.json'
18+
# Read more about logging: https://bref.sh/docs/environment/logs
19+
LOG_CHANNEL: stderr
20+
LOG_STDERR_FORMATTER: Bref\Monolog\CloudWatchFormatter
3121

3222
functions:
3323

@@ -50,6 +40,22 @@ functions:
5040
# rate: rate(1 minute)
5141
# input: '"schedule:run"'
5242

43+
package:
44+
# Files and directories to exclude from deployment
45+
patterns:
46+
- '!node_modules/**'
47+
- '!public/storage'
48+
- '!resources/assets/**'
49+
- '!resources/css/**'
50+
- '!resources/images/**'
51+
- '!resources/js/**'
52+
- '!storage/**'
53+
- '!tests/**'
54+
- '!database/*.sqlite'
55+
# Exclude assets except for the manifest file
56+
- '!public/build/**'
57+
- 'public/build/manifest.json'
58+
5359
plugins:
5460
# We need to include the Bref plugin
5561
- ./vendor/bref/bref

0 commit comments

Comments
 (0)