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

Default loger while publishing has not index enable #6

Closed
DenisOgr opened this issue May 2, 2017 · 1 comment
Closed

Default loger while publishing has not index enable #6

DenisOgr opened this issue May 2, 2017 · 1 comment

Comments

@DenisOgr
Copy link

DenisOgr commented May 2, 2017

I use follow producer settings:

'producers' => [
    'test' => [
        'connection' => 'default',
        'exchange_options' => [
            'name' => 'test',
            'type' => 'direct',
            'declare' => true,
        ],
    ],
],

and I dont want use logger.
But I get error 'Undefined index: enable'

I explain this library and I found this code

if ($this->logger['enable']) {
.....
}

in vendor/mikemadisonweb/yii2-rabbitmq/components/Producer.php:73
but in this place $this->logger is equal null.

PS: also I found this code:

 $this->logger = array_replace($this->getDefaultLoggerOptions(), $this->logger);

in vendor/mikemadisonweb/yii2-rabbitmq/Configuration.php:143 (in method loadConsumers)

Why you didnt use getDefaultLoggerOptions in method loadProducers ?
How to fix it?

@mikemadisonweb
Copy link
Owner

Hi Denis,
Logger defaults setter has been added to Producer invocation as well: https://github.com/mikemadisonweb/yii2-rabbitmq/blob/master/Configuration.php#L82
Thank you for contribution.
To fix your error, please update package to the latest version (1.5.1 currently) and you should be fine. Also, be advised that in new version queue and exchange default options was changed. There is a new section in README file about that: https://github.com/mikemadisonweb/yii2-rabbitmq#defaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants