-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the WithLoggerChannel attribute to autoconfigure the channel
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\MonologBundle\Attribute; | ||
|
||
/** | ||
* Autoconfigures the logger channel used when inject a logger in the service. | ||
* | ||
* This adds the `monolog.logger` tag on the service definition. | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_CLASS)] | ||
final class WithLoggerChannel | ||
{ | ||
/** | ||
* @readonly | ||
*/ | ||
public string $channel; | ||
|
||
public function __construct(string $channel) | ||
{ | ||
$this->channel = $channel; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters