How to debug python beaver?

528 Views Asked by At

I have python beaver service running on my machine. Its configured along with logstash to push logs to kibana dashboard. For some reason beaver is not collecting logs of the services for the starting 15min. I want to debug beaver but not sure how to do so.

I tried running the command:

/usr/bin/beaver -c /etc/beaver/conf

The Output is get is

[2014-12-18 16:42:06,084] INFO    Starting worker...
[2014-12-18 16:42:06,085] INFO    Working...
[2014-12-18 16:42:06,092] INFO    [fe01g1e15e8] - watching logfile <some-log-file>
[2014-12-18 16:42:06,092] INFO    [fe01g1e15ed] - watching logfile <some-log-file>
[2014-12-18 16:42:06,093] INFO    [fe01g14105c] - watching logfile <some-log-file>
[2014-12-18 16:42:06,193] INFO    Starting queue consumer

The functionality is working just fine. But how do i debug on what happened to the first 15min? Also, there are no log files for beaver

1

There are 1 best solutions below

0
On

I found out that the best method for debuging beaver is to work closely with the open source code.

First of all for debuging use the parameter --debug to get more log infromation and then look in the code for the parts that collects the data or look for the problematic error prints that you recieve from the debug messages. You can also add your own prints and temporarily replace the code on your server in order to understand were the problematic part might be.

From what I know, your problem can be in one of two parts, the first part consumes the data into an internal queue and the second part gets information from the queue and sends it using the selected transport method (in your case to logstash).

I already have a pull request waiting for approval that will include prints with the status of the number of messages in the queue and the number of messages transported (in debug mode) and I guess this can really help you understand what part is not working.

https://github.com/josegonzalez/python-beaver/pull/324