Skip to content

Commit

Permalink
logging: custom creator class receives config
Browse files Browse the repository at this point in the history
  • Loading branch information
mfn authored Feb 8, 2018
1 parent eb34d6c commit 9e729f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ If you would like to define an entirely custom channel in which you have full co
],
],

Once you have configured the `custom` channel, you're ready to define the class that will create your Monolog instance. This class only needs a single method: `__invoke`, which should return the Monolog instance:
Once you have configured the `custom` channel, you're ready to define the class that will create your Monolog instance. This class only needs a single method: `__invoke`, which will receive your configuration and should return the Monolog instance:

<?php

Expand All @@ -195,9 +195,10 @@ Once you have configured the `custom` channel, you're ready to define the class
/**
* Create a custom Monolog instance.
*
* @param array $config
* @return \Monolog\Logger
*/
public function __invoke()
public function __invoke($config)
{
return new Logger(...);
}
Expand Down

0 comments on commit 9e729f0

Please sign in to comment.