2017 © Pedro Peláez
 

library nette-new-relic-logger

Logger decorator to New Relic for Nette Framework and Tracy

image

kusebauch/nette-new-relic-logger

Logger decorator to New Relic for Nette Framework and Tracy

  • Monday, June 20, 2016
  • by patrickkusebauch
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,229 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

nette-new-relic-logger

Logging application requests

Logs all requests to Nette application and records application exceptions other than 404s. But does not record errors in the code., (*1)

1) with running only when your NewRelic is - installed - enabled - configured with Bootstrap::setup(), (*2)

$application = new Application();
\Kusebauch\NetteNewRelicLogger\Bootstrap::addOnError(['\Kusebauch\NetteNewRelicLogger\Utils', onAppError], $application);
\Kusebauch\NetteNewRelicLogger\Bootstrap::addOnRequest(['\Kusebauch\NetteNewRelicLogger\Utils', onAppRequest], $application);

2) try to run anyway (will be problematic, if you don't have NewRelic agent installed), (*3)

$application = new Application();
$application->onError[] = ['\Kusebauch\NetteNewRelicLogger\Utils', onAppError];
$application->onRequest[] = ['\Kusebauch\NetteNewRelicLogger\Utils', onAppRequest];

Logging application errors

Create a decorator over the current Tracy logger. Your application will keep logging the same way as it was up until now, but on top it will log to New Relic., (*4)

$oldLogger = \Tracy\Debugger::getLogger();
$newLogger = new \Kusebauch\NetteNewRelicLogger\Bridges\Tracy\LoggerDecorator($oldLogger);
$newLogger->excludeMessageFunc[] = ['\Kusebauch\NetteNewRelicLogger\Utils', 'noticeLoggerFilter'];
$newLogger->excludeMessageFunc[] = ['\Kusebauch\NetteNewRelicLogger\Utils', 'strictLoggerFilter'];
$newLogger->includeMessageFunc[] = function ($message, $priority) { 
    return in_array($priority, [\Tracy\ILogger::CRITICAL, \Tracy\ILogger::ERROR, \Tracy\ILogger::EXCEPTION]);
};
\Tracy\Debugger::setLogger($newLogger);

The Versions

20/06 2016

dev-Legacy

dev-Legacy

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

20/06 2016

0.9.4

0.9.4.0

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

29/05 2016

dev-master

9999999-dev

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

29/05 2016

0.9.3

0.9.3.0

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

29/05 2016

1.0.1

1.0.1.0

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

25/05 2016

0.9.2

0.9.2.0

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

24/05 2016

0.9.1

0.9.1.0

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch

06/05 2016

1.0.0

1.0.0.0

Logger decorator to New Relic for Nette Framework and Tracy

  Sources   Download

MIT-X11

The Requires

 

The Development Requires

by Patrick Kusebauch