|
367 | 367 |
|
368 | 368 | // Resolve the stack channel in the central context first |
369 | 369 | // (this caches the stack with its members still pointing at the central logs). |
370 | | - Log::channel('custom_stack')->info('central'); |
371 | | - expect(file_get_contents($centralLogPath))->toContain('central'); |
| 370 | + Log::channel('custom_stack')->info('central log message'); |
| 371 | + expect(file_get_contents($centralLogPath))->toContain('central log message'); |
372 | 372 |
|
373 | 373 | tenancy()->initialize($tenant); |
374 | 374 |
|
|
379 | 379 | // so 'tenant log message' should be logged to the tenant log, |
380 | 380 | // not the central log. |
381 | 381 | expect(file_get_contents($centralLogPath)) |
382 | | - ->toContain('central') |
| 382 | + ->toContain('central log message') |
383 | 383 | ->not()->toContain('tenant log message'); |
384 | 384 |
|
385 | 385 | $tenantLogPath = storage_path('logs/laravel.log'); |
386 | | - |
387 | 386 | expect(file_exists($tenantLogPath))->toBeTrue(); |
388 | 387 | expect(file_get_contents($tenantLogPath)) |
389 | 388 | ->toContain('tenant log message'); |
| 389 | + |
| 390 | + tenancy()->end(); |
| 391 | + |
| 392 | + Log::channel('custom_stack')->info('central after revert'); |
| 393 | + |
| 394 | + expect(file_get_contents($centralLogPath)) |
| 395 | + ->toContain('central log message') |
| 396 | + ->toContain('central after revert') |
| 397 | + ->not()->toContain('tenant log message'); |
| 398 | + |
| 399 | + expect(file_get_contents($tenantLogPath)) |
| 400 | + ->toContain('tenant log message') |
| 401 | + ->not()->toContain('central after revert'); |
390 | 402 | }); |
391 | 403 |
|
392 | 404 | test('slack channel uses correct webhook urls', function () { |
|
0 commit comments