MySQL Database logger

I am looking at creating an events logger on a raspberry pi web server running php and MySQL. From my searching it sounds like people have been tying to create one before but couldn’t find any examples. If there is any can someone point me in the right direction if not I will get to work :nerd:.

There are several examples of “loggers” on the community, you will need to subscribe to events and push them to the pi through a port forward.

I suppose this logger would be right up your alley for MySQL.

1 Like

Thanks guys :grinning:. I have seen these examples and was wondering is anyone had used MySQL specifically to save me having to reinvent the wheel. I am sure with these examples I can get some thing up and running thanks for the help.

I think the reason why there aren’t many MySQL examples for event logging solutions is because there are several popular time-series database (TSDB) stacks available that are more-suited to the task. These tend to have native support for things like retention policies and down-sampling etc, as well as being easy to integrate with popular data collection and visualisation tools. E.g. the Influx Data stack (Telegraf / InfluxDB / Chronograf / Kapacitor), Graphite, or the Elastic stack (Elasticsearch, Kibana, Logstash, and Beats), which is really powerful. Just pick the bits you need, bolt them together, and away you go.

I could have spent weeks writing my own custom logging solution on top of LAMP, but instead learnt and built a solution using InfluxDB and Grafana in less than a day. :sunglasses:

1 Like

I wish I had seen this 4 years ago…But thanks for the direction having just built a LAMP and now pushing stuff to Grafana I thought I would bite the bullet and come back to all my SmartThings data…

I’m now busy looking at InfluxDB and Prometheus