Multiple services of type Tracy\ILogger found

6 months ago

washo
Member | 90
+
0
-

Hello, have you ever tried to have another logger (Tracy\Logger) in the app? I would like to have another named log service for some manualy loged errors, but I'm getting exception ‘Service 'application.2’: Multiple services of type Tracy\ILogger found' .
Second logger has it's name. But is there any way how to disable autowiring for this one?

services:
    ...
    apiLogger: Tracy\Logger(%logDir%/apiLogs)
    apiClient: App\Api\Client(%apiClient%, @apiLogger)
    ...

6 months ago

David Matějka
Moderator | 5541
+
+1
-

Hi, yes, you can disable autowiring for your logging service. see the doc: https://doc.nette.org/…onfiguration#…

6 months ago

washo
Member | 90
+
0
-

David Matějka wrote:

Hi, yes, you can disable autowiring for your logging service. see the doc: https://doc.nette.org/…onfiguration#…

Man, thank you, you are awesome. I've missed the link this comprehensive neon doc.