Skip to content

Replace singleton Logger #3

Closed
Closed
@thekid

Description

@thekid

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_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions