Replace singleton Logger
Closed this issue · 1 comments
thekid commented
The util.log.Logger
class should be replaced by a new API simplifying setup code.
Here are some ideas:
- Configurable via ini file (like the old logger, but more elegant syntax) and/or programmatically via fluent interface
- Can define policies (in form of an interface, which users can implement) to steer what is logged where
- ...
$logging= (new Logging())
->in((new ServerMode('prod'))
->log()->to(new FileAppender('application.log')) // Default category
->log('sql')->to(new FileAppender('sql.log'))
->using(new ErrorsOnly())
)
->log('default')->to(new ConsoleAppender())
;
$logging->category()->info('Starting application');
_:warning: Work in progress_