Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation MonologListener #48

Closed
mimmi20 opened this issue Jan 26, 2022 · 1 comment
Closed

Documentation MonologListener #48

mimmi20 opened this issue Jan 26, 2022 · 1 comment

Comments

@mimmi20
Copy link

mimmi20 commented Jan 26, 2022

We want to use Monolog in our Projects. In these Projects we also use Phing.

Could you add an Example which describes how to use/configure the MonologListener?

@siad007
Copy link
Member

siad007 commented Jan 26, 2022

To just "use" the MonologListener, you start phing with this command:

phing -listener "Phing\\Listener\\MonologListener"

Configuration is not (yet) implemented, but you could easily extend the given MonologListener by your own Listener/Logger implementation or make some PR :)

As an example you could write a simple class like:

<?php

namespace Foo\Bar\CustomMonologListener;

use Monolog\Logger;

class CustomMonologLogger extends MonologListener
{
    /**
     * Override parent constructor with your custom configuration
     */
    public function __construct()
    {
        $this->log = new Logger(self::LOG_PHING);
        // ... do some more with it here
    }
}

And then start phing like:

phing -listener "Foo\\Bar\\CustomMonologListener"

Related to #43
and related to #46

@mrook mrook transferred this issue from phingofficial/phing Jun 23, 2022
@mrook mrook closed this as completed in cec6305 Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants