Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Log to syslog from lua script


Question

Posted

Dear community,

 

Has anybody figured out how to send log statements to a syslog server from lua scripts? I want to do a more systematic logging so I can figure out better when scripts have failed and why. Doing print() statements is not a structural solution.

 

Harald

5 answers to this question

Recommended Posts

  • 0
Posted

I've got the same question. I would like to see some better logging capability than just having the output in the output window. There is no easy way to see what the state of the HC2 is when you have to click around to every scene to see if there have been any errors.

  • 0
Posted
11 minutes ago, Tor Magnus said:

I've got the same question. I would like to see some better logging capability than just having the output in the output window. There is no easy way to see what the state of the HC2 is when you have to click around to every scene to see if there have been any errors.

 

its not quite the same but I use a a small function in each scene/vd along with a predefined global variable to append data to MY log aling with a rough date and time stamp

i can then look back at the log or add extra logging to a scene/vd is its something new I'm working on. This approach has allowed me to see how a couple of scenes interact.

 

this is the function I use - its a bit rough but works

 

Please login or register to see this code.

-f 

  • 0
Posted

In the end I went for a slightly different take.

 

I've got two python scripts, one for pulling log messages out of <fibarohost>/api/scenes/<scene>/debugMessages and the other for pulling stats from devices.

I stick the logs and the metrics into a container running elasticsearch and then read that from a container running kibana.

 

 

Please login or register to see this attachment.

  • 0
Posted

Nice, @Tor Magnus! I have done something very similar, but using influxdb and grafana. See also my post below.

 

  • 0
Posted

Cool @ReneNL, great minds think alike. I was looking at influxdb/grafana at first myself as I'd used it before, however as I wanted debug messages as well it was a bit of a hassle. I might still hook up grafana to elasticsearch, however a greater concern for me at the moment seems to be the unreliability of data logging from the Aeotec 6in1... :(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...