clockwork.php
14.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<?php
return [
/*
|--------------------------------------------------------------------------
| Enable Clockwork
|--------------------------------------------------------------------------
|
| You can explicitly enable or disable Clockwork here. When enabled, special
| headers for communication with the Clockwork Chrome extension will be
| included in your application responses and requests data will be available
| at /__clockwork url.
| When set to null, Clockwork behavior is controlled by app.debug setting.
| Default: null
|
*/
'enable' => env('CLOCKWORK_ENABLE', null),
/*
|--------------------------------------------------------------------------
| Features
|--------------------------------------------------------------------------
|
| You can enable or disable various Clockwork features here. Some features
| accept additional configuration (eg. slow query threshold for database).
|
*/
'features' => [
// Cache usage stats and cache queries including results
'cache' => [
'enabled' => env('CLOCKWORK_CACHE_ENABLED', true),
// Collect cache queries including results (high performance impact with a high number of queries)
'collect_queries' => env('CLOCKWORK_CACHE_QUERIES', false)
],
// Database usage stats and queries
'database' => [
'enabled' => env('CLOCKWORK_DATABASE_ENABLED', true),
// Collect database queries (high performance impact with a very high number of queries)
'collect_queries' => env('CLOCKWORK_DATABASE_COLLECT_QUERIES', true),
// Query execution time threshold in miliseconds after which the query will be marked as slow
'slow_threshold' => env('CLOCKWORK_DATABASE_SLOW_THRESHOLD'),
// Collect only slow database queries
'slow_only' => env('CLOCKWORK_DATABASE_SLOW_ONLY', false),
// Detect and report duplicate (N+1) queries
'detect_duplicate_queries' => env('CLOCKWORK_DATABASE_DETECT_DUPLICATE_QUERIES', false)
],
// Sent emails
'emails' => [
'enabled' => env('CLOCKWORK_EMAILS_ENABLED', true),
],
// Dispatched events
'events' => [
'enabled' => env('CLOCKWORK_EVENTS_ENABLED', true),
// Ignored events (framework events are ignored by default)
'ignored_events' => [
// App\Events\UserRegistered::class,
// 'user.registered'
],
],
// Laravel log (you can still log directly to Clockwork with laravel log disabled)
'log' => [
'enabled' => env('CLOCKWORK_LOG_ENABLED', true)
],
// Dispatched queue jobs
'queue' => [
'enabled' => env('CLOCKWORK_QUEUE_ENABLED', true)
],
// Redis commands
'redis' => [
'enabled' => env('CLOCKWORK_REDIS_ENABLED', true)
],
// Routes list
'routes' => [
'enabled' => env('CLOCKWORK_ROUTES_ENABLED', false)
],
// Rendered views
'views' => [
'enabled' => env('CLOCKWORK_VIEWS_ENABLED', true),
// Collect views including view data (high performance impact with a high number of views)
'collect_data' => env('CLOCKWORK_VIEWS_COLLECT_DATA', false),
// Use Twig profiler instead of Laravel events for apps using laravel-twigbridge (more precise, but does
// not support collecting view data)
'use_twig_profiler' => env('CLOCKWORK_VIEWS_USE_TWIG_PROFILER', false)
]
],
/*
|--------------------------------------------------------------------------
| Enable web UI
|--------------------------------------------------------------------------
|
| Enable or disable the Clockwork web UI available at http://your.app/__clockwork.
| You can also set whether to use the dark theme by default.
| Default: true
|
*/
'web' => env('CLOCKWORK_WEB', true),
/*
|--------------------------------------------------------------------------
| Artisan commands collection
|--------------------------------------------------------------------------
|
| You can enable or disable and configure collection of executed Artisan
| commands here.
|
*/
'artisan' => [
// Enable or disable collection of executed Artisan commands
'collect' => env('CLOCKWORK_ARTISAN_COLLECT', true),
// List of commands that should not be collected (built-in commands are not collected by default)
'except' => [
// 'inspire'
],
// List of commands that should be collected, any other command will not be collected if not empty
'only' => [
// 'inspire'
],
// Enable or disable collection of command output
'collect_output' => env('CLOCKWORK_ARTISAN_COLLECT_OUTPUT', false),
// Enable or disable collection of built-in Laravel commands
'except_laravel_commands' => env('CLOCKWORK_ARTISAN_EXCEPT_LARAVEL_COMMANDS', true)
],
/*
|--------------------------------------------------------------------------
| Queue jobs collection
|--------------------------------------------------------------------------
|
| You can enable or disable and configure collection of executed queue jobs
| here.
|
*/
'queue' => [
// Enable or disable collection of executed queue jobs
'collect' => env('CLOCKWORK_QUEUE_COLLECT', true),
// List of queue jobs that should not be collected
'except' => [
// App\Jobs\ExpensiveJob::class
],
// List of queue jobs that should be collected, any other queue job will not be collected if not empty
'only' => [
App\Jobs\Clients\SendEmailOrder::class,
App\Jobs\Clients\GenerateExportSale::class,
App\Jobs\Clients\SendEmailActivate::class,
App\Jobs\Systems\SendEmailRegistrationActivate::class,
App\Jobs\Systems\SendEmailReminder::class,
App\Jobs\Systems\SubsystemCreateSsl::class,
App\Jobs\Systems\SubsystemDelete::class,
App\Jobs\Systems\SubsystemDeleteSsl::class,
App\Jobs\Systems\SubsystemDeploy::class,
App\Jobs\Systems\SubsystemUpdate::class,
App\Jobs\Systems\SubsystemUpdateSsl::class,
App\Jobs\Systems\Evotor\SendEmailRegistration::class,
]
],
/*
|--------------------------------------------------------------------------
| Tests collection
|--------------------------------------------------------------------------
|
| You can enable or disable and configure collection of ran tests here.
|
*/
'tests' => [
// Enable or disable collection of ran tests
'collect' => env('CLOCKWORK_TESTS_COLLECT', false),
// List of tests that should not be collected
'except' => [
// Tests\Unit\ExampleTest::class
]
],
/*
|--------------------------------------------------------------------------
| Enable data collection, when Clockwork is disabled
|--------------------------------------------------------------------------
|
| This setting controls, whether data about application requests will be
| recorded even when Clockwork is disabled (useful for later analysis).
| Default: false
|
*/
'collect_data_always' => env('CLOCKWORK_COLLECT_DATA_ALWAYS', false),
/*
|--------------------------------------------------------------------------
| Metadata storage
|--------------------------------------------------------------------------
|
| You can configure how are the metadata collected by Clockwork stored.
| Valid options are: files or sql.
| Files storage stores the metadata in one-per-request files in a specified
| directory.
| Sql storage stores the metadata as rows in a sql database. You can specify
| the database by name if defined in database.php or by path to Sqlite
| database. Database table will be automatically created.
| Sql storage requires PDO.
|
*/
'storage' => env('CLOCKWORK_STORAGE', 'files'),
'storage_files_path' => env('CLOCKWORK_STORAGE_FILES_PATH', storage_path('clockwork')),
// Compress the metadata files using gzip, trading a little bit of performance for lower disk usage
'storage_files_compress' => env('CLOCKWORK_STORAGE_FILES_COMPRESS', false),
'storage_sql_database' => env('CLOCKWORK_STORAGE_SQL_DATABASE', storage_path('clockwork.sqlite')),
'storage_sql_table' => env('CLOCKWORK_STORAGE_SQL_TABLE', 'clockwork'),
/*
|--------------------------------------------------------------------------
| Metadata expiration
|--------------------------------------------------------------------------
|
| Maximum lifetime of the metadata in minutes, metadata for older requests
| will automatically be deleted when storing new requests.
| When set to false, metadata will never be deleted.
| Default: 1 week
|
*/
'storage_expiration' => env('CLOCKWORK_STORAGE_EXPIRATION', 60 * 24 * 7),
/*
|--------------------------------------------------------------------------
| Authentication
|--------------------------------------------------------------------------
|
| Clockwork can be configured to require authentication before allowing
/ access to the collected data. This is recommended when the application
/ is publicly accessible, as the metadata might contain sensitive information.
/ Setting to "true" enables authentication with a single password set below,
/ "false" disables authentication.
/ You can also pass a class name of a custom authentication implementation.
/ Default: false
|
*/
'authentication' => env('CLOCKWORK_AUTHENTICATION', false),
'authentication_password' => env('CLOCKWORK_AUTHENTICATION_PASSWORD', 'VerySecretPassword'),
/*
|--------------------------------------------------------------------------
| Disable data collection for certain URIs or methods
|--------------------------------------------------------------------------
|
| You can disable data collection for specific URIs by adding matching
| regular expressions here. You can also disable collecting all requests
| with a specific method.
|
*/
'filter_uris' => [
'/horizon/.*', // Laravel Horizon requests
'/telescope/.*', // Laravel Telescope requests
],
'filter_methods' => [
'options' // mostly used in the csrf pre-flight requests and is rarely of interest
],
/*
|--------------------------------------------------------------------------
| Enable collecting of stack traces
|--------------------------------------------------------------------------
|
| This setting controls, whether log messages and certain data sources, like
/ the database or cache data sources, should collect stack traces.
/ You might want to disable this if you are collecting 100s of queries or
/ log messages, as the stack traces can considerably increase the metadata size.
/ You can force collecting of stack trace for a single log call by passing
/ [ 'trace' => true ] as $context.
| Default: true
|
*/
'stack_traces' => [
// Enable or disable collecting of stack traces, when disabled only caller file and line number is collected
'enabled' => env('CLOCKWORK_STACK_TRACES_ENABLED', true),
// List of vendor names to skip when determining caller, common vendor are automatically added
'skip_vendors' => [
// 'phpunit'
],
// List of namespaces to skip when determining caller
'skip_namespaces' => [
// 'Laravel'
],
// List of class names to skip when determining caller
'skip_classes' => [
// App\CustomLog::class
],
// Limit of frames to be collected
'limit' => env('CLOCKWORK_STACK_TRACES_LIMIT', 10)
],
/*
|--------------------------------------------------------------------------
| Serialization
|--------------------------------------------------------------------------
|
| Configure how Clockwork serializes the collected data.
| Depth limits how many levels of multi-level arrays and objects have
| extended serialization (rest uses simple serialization).
| Blackbox allows you to specify classes which contents should be never
| serialized (eg. a service container class).
| Lowering depth limit and adding classes to blackbox lowers the memory
| usage and processing time.
|
*/
'serialization_depth' => env('CLOCKWORK_SERIALIZATION_DEPTH', 10),
'serialization_blackbox' => [
\Illuminate\Container\Container::class,
\Illuminate\Foundation\Application::class,
\Laravel\Lumen\Application::class
],
/*
|--------------------------------------------------------------------------
| Register helpers
|--------------------------------------------------------------------------
|
| This setting controls whether the "clock" helper function will be registered. You can use the "clock" function to
| quickly log something to Clockwork or access the Clockwork instance.
|
*/
'register_helpers' => env('CLOCKWORK_REGISTER_HELPERS', true),
/*
|--------------------------------------------------------------------------
| Send Headers for AJAX request
|--------------------------------------------------------------------------
|
| When trying to collect data the AJAX method can sometimes fail if it is
| missing required headers. For example, an API might require a version
| number using Accept headers to route the HTTP request to the correct
| codebase.
|
*/
'headers' => [
// 'Accept' => 'application/vnd.com.whatever.v1+json',
],
/*
|--------------------------------------------------------------------------
| Server-Timing
|--------------------------------------------------------------------------
|
| Clockwork supports the W3C Server Timing specification, which allows for
/ collecting a simple performance metrics in a cross-browser way. Eg. in
/ Chrome, your app, database and timeline event timings will be shown
/ in the Dev Tools network tab.
/ This setting specifies the max number of timeline events that will be sent.
| When set to false, Server-Timing headers will not be set.
| Default: 10
|
*/
'server_timing' => env('CLOCKWORK_SERVER_TIMING', 10)
];