@@ -43,47 +43,71 @@ Adjust the configuration file to suite your application.
43
43
44
44
``` php
45
45
[
46
- 'enabled' => true, // Do you want to capture queries?
47
- 'token' => env('QUERY_WATCH_TOKEN', 'change_me'), // Token used for Authenticating Private Broadcast Channel
46
+ // Do you want to capture queries?
47
+ 'enabled' => env('QUERY_WATCH_ENABLED', true),
48
+
49
+ // Token used for Authenticating Private Broadcast Channel
50
+ 'token' => env('QUERY_WATCH_TOKEN', 'change_me'),
48
51
'scope' => [
49
52
'time_exceeds_ms' => [
50
- 'enabled' => true, // Do you want to capture everything or only slow queries?
51
- 'threshold' => 500, // The number of milliseconds it took to execute the query.
53
+ // Do you want to capture everything or only slow queries?
54
+ 'enabled' => env('QUERY_WATCH_SCOPE_TIME_ENABLED', true),
55
+
56
+ // The number of milliseconds it took to execute the query.
57
+ 'threshold' => env('QUERY_WATCH_SCOPE_TIME_THRESHOLD', 500),
52
58
],
53
59
'context' => [
54
60
'auth_user' => [
55
- 'enabled' => true, // Do you want to know context of the authenticated user when query is captured?
56
- 'ttl' => 300, // How long do you want the session_id/authenticated user cached for?
57
- // without this cache, your application will infinite loop because it will capture
58
- // the user query and loop.
59
- // See closed Issue #1 for context.
61
+ // Do you want to know context of the authenticated user when query is captured?
62
+ 'enabled' => env('QUERY_WATCH_SCOPE_CONTEXT_AUTH_ENABLED', true),
63
+
64
+ // How long do you want the session_id/authenticated user cached for?
65
+ // without this cache, your application will infinite loop because it will capture
66
+ // the user query and loop.
67
+ // See closed Issue #1 for context.
68
+ 'ttl' => env('QUERY_WATCH_SCOPE_CONTEXT_AUTH_TTL', 300),
60
69
],
61
70
'trigger' => [
62
- 'enabled' => true, // Do you want to know what triggered the query?
63
- // i.e Console command or Request
71
+ // Do you want to know what triggered the query?
72
+ // i.e Console command or Request
73
+ 'enabled' => env('QUERY_WATCH_SCOPE_TRIGGER_ENABLED', true),
64
74
],
65
75
],
66
76
'ignorable_tables' => [
67
- 'jobs' // Do you want to capture queries on specific tables?
68
- // If you are utilizing the database queue driver, you need to
69
- // ignore the jobs table or you'll get infinite capture loops.
77
+ // Do you want to capture queries on specific tables?
78
+ // If you are utilizing the database queue driver, you need to
79
+ // ignore the jobs table, or you'll potentially get infinite capture loops.
80
+ 'jobs'
70
81
],
71
82
'ignorable_statements' => [
72
- 'create' // Do you want to ignore specific SQL statements?
83
+ // Do you want to ignore specific SQL statements?
84
+ 'create'
73
85
]
74
86
],
75
- 'listener' => [ // Channel notifications are queued
76
- 'connection' => 'sync', // Define what connection to use.
77
- 'queue' => 'default', // Define what queue to use
78
- 'delay' => null, // Do you want to delay the notifications at all?
87
+ 'listener' => [
88
+ // Channel notifications are queued
89
+ // Define what connection to use.
90
+ 'connection' => 'sync',
91
+
92
+ // Define what queue to use
93
+ 'queue' => 'default',
94
+
95
+ // Do you want to delay the notifications at all?
96
+ 'delay' => null,
79
97
],
80
98
'channels' => [ // Where to send notifications?
81
99
'discord' => [
82
- 'enabled' => false, // Do you want discord webhook notifications?
100
+ // Do you want discord webhook notifications?
101
+ 'enabled' => env('QUERY_WATCH_CHANNEL_DISCORD_ENABLED', false),
102
+
103
+ // Discord Web-hook URL
83
104
'hook' => env('DISCORD_HOOK', 'please_fill_me_in'),
84
105
],
85
106
'slack' => [
86
- 'enabled' => false, // Do you want Slack webhook notifications?
107
+ // Do you want Slack webhook notifications?
108
+ 'enabled' => env('QUERY_WATCH_CHANNEL_SLACK_ENABLED', false),
109
+
110
+ // Slack Web-hook URL
87
111
'hook' => env('SLACK_HOOK', 'please_fill_me_in'),
88
112
],
89
113
]
@@ -143,6 +167,7 @@ Once you have done this, you can enable Discord Notifications in the configurati
143
167
144
168
- [ Notification Channels Wiki] ( https://github.com/YorCreative/Laravel-Query-Watcher/wiki/Notification-Channels )
145
169
- [ Screenshots] ( https://github.com/YorCreative/Laravel-Query-Watcher/wiki/Screenshots )
170
+
146
171
## Testing
147
172
148
173
``` bash
0 commit comments