Recommended way to have multiple loggers

adrianbj
Member | 31
+
0
-

When I add a custom logger via setLogger, the default mail logger no longer works. Is there a correct way to have multiple loggers? Otherwise it looks like I might need to do something like https://github.com/…relic-logger#… where it defines the old logger and then call that within the log method of the new logger: https://github.com/…ecorator.php#L37

Any ideas?

Rick Strafy
Nette Blogger | 81
+
0
-

Try to use monolog for logging – https://contributte.org/…monolog.html and then add New Relic as a monolog handler to your configuration – https://github.com/…enricher-php

Last edited by Rick Strafy (2022-10-23 23:35)

Marek Bartoš
Nette Blogger | 1261
+
0
-

orisai/nette-monolog supports multiple standalone loggers as well as logging from Monolog to Tracy and from Tracy to Monolog without breaking the original Tracy logger. Each standalone logger allows logging via multiple handlers at once (NewRelic, email, file, Tracy panel, …)