SoCloz / SoclozMonitoringBundle

A profiling/monitoring Symfony2 bundle for production servers - alerts on exceptions, logs profiling data & sends data to statsd/graphite
MIT License
69 stars 6 forks source link

issue Profiler Argument #19

Open tanguybernard opened 8 years ago

tanguybernard commented 8 years ago

Hello, After installing SoclozMonitoringBundle, I encountered this error: ContextErrorException: Catchable Fatal Error: Argument 2 passed to Socloz\MonitoringBundle\Listener\Profiler::__construct() must be an instance of Socloz\MonitoringBundle\Notify\StatsD\StatsDInterface, null given, called in /project/app/cache/dev/appDevDebugProjectContainer.php on line 5127 and defined in /project/vendor/socloz/monitoring-bundle/Listener/Profiler.php line 58

app/config/config/yml

socloz_monitoring:
    exceptions:
        enable: true
    profiler:
        enable: true
        request: true
    mailer:
        enable: true
        from: monitor@mail.com
        to: monitor@mail.com
    statsd:
        enable: false
        host: nowhere
        port: 42
        merge_packets: true

Did I forget something ?

I would like to know execution time of my rest api in production. And other stats of functions.

Thanks in advance.

Tanguy

mhor commented 8 years ago

Hi @tanguybernard could you try to replace (https://github.com/SoCloz/SoclozMonitoringBundle/blob/master/Listener/Profiler.php#L58):

public function __construct(Xhprof $profiler, StatsDInterface $statsd, Logger $logger = null, $sampling = 100)

by:

public function __construct(Xhprof $profiler, StatsDInterface $statsd = null, Logger $logger = null, $sampling = 100)

If it's solve your problem could you do a pull request.

tanguybernard commented 8 years ago

Thanks @mhor ! It's solved my problem.

One more question :) I expected a new element in my profiler symfony with this configuration:

profiler:
    enable: true
    sampling: 50
    request: true

But nothing appears, did I miss something ?