theorchard / monolog-cascade

Configure multiple loggers and handlers in the blink of an eye
MIT License
145 stars 62 forks source link

Add default logger #73

Closed euprogramador closed 6 years ago

euprogramador commented 7 years ago

Create a default logger (handlers and processors)

rantonmattei commented 7 years ago

If you do:

$logger = Cascade::getLogger('default');
// 'default' can be anything, this is just an example.
// It cannot be empty because Cascade relies on a Registry

=> you'll get an empty logger. See https://github.com/theorchard/monolog-cascade/blob/master/src/Cascade.php#L72-L75

The issue with having a default logger is the default handler/processor. Everybody might want something different (std out, file, etc.). I think this is easy enough to add a handler whether you do it with Cascade or Monolog directly ($logger->pushHandler(new StreamHandler('php://stdout'));)

So, I'd probably say no.

FYI @jessmchung

euprogramador commented 6 years ago

Thanks, i am close this issue