Replace Monolog middlewares by an event listener

This is an alternative to the changes introduced by #894 in order to allow replacement of the logging middlewares.
Instead of having a Closure for each listener, this PR introduces a listener class.
The event listener introduced by this PR can be used independently from the MonologServiceProvider.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #870
| License       | MIT
| Doc          | yes

I'll add tests if you agree with this solution.