Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 26, 2021
1 parent b7d77d1 commit 5b3fc4e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,14 @@ Sometimes you may wish to log a message to a channel other than your application

Log::channel('slack')->info('Something happened!');

It is also possible to create an on-demand channel by providing the configuration at runtime without that configuration being
present in your application's `logging` configuration file. To accomplish this, you may pass a configuration array to the
the `Log` facade's `build` method:
If you would like to create an on-demand logging stack consisting of multiple channels, you may use the `stack` method:

Log::stack(['single', 'slack'])->info('Something happened!');

<a name="on-demand-channels"></a>
#### On-Demand Channels

It is also possible to create an on-demand channel by providing the configuration at runtime without that configuration being present in your application's `logging` configuration file. To accomplish this, you may pass a configuration array to the the `Log` facade's `build` method:

use Illuminate\Support\Facades\Log;

Expand All @@ -238,12 +243,7 @@ It is also possible to create an on-demand channel by providing the configuratio
'path' => storage_path('logs/custom.log'),
])->info('Something happened!');

If you would like to create an on-demand logging stack consisting of multiple channels, you may use the `stack` method:

Log::stack(['single', 'slack'])->info('Something happened!');

You may also wish to include an on-demand channel in an on-demand logging stack. This can be achieved by including your
on-demand channel instance in the array passed to the `stack` method:
You may also wish to include an on-demand channel in an on-demand logging stack. This can be achieved by including your on-demand channel instance in the array passed to the `stack` method:

use Illuminate\Support\Facades\Log;

Expand All @@ -254,7 +254,6 @@ You may also wish to include an on-demand channel in an on-demand logging stack.

Log::stack(['slack', $channel])->info('Something happened!');


<a name="monolog-channel-customization"></a>
## Monolog Channel Customization

Expand Down

0 comments on commit 5b3fc4e

Please sign in to comment.