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

Scene debug log rotation mechanism


wpeeters
 Share

Question

Hi, can somebody explain me how the debug in scenes is working?
Meaning, how many records HC2 will store maximum (or characters), what's the rotation mechanism, .... ?
The reason I ask, In some scene's I can find a lot of history (with a lot of text). In others only some hours (where text is even very limited).
Thanks.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • All, Nobody that help me? Still not clear to me how many records are kept in the log information of a scene.
    For some, I can see a lot of history. For some scene's, only some hors. Is it row based, size based, time based?

    thanks.

    Link to comment
    Share on other sites

    • 0
    1 hour ago, wpeeters said:

    All, Nobody that help me? Still not clear to me how many records are kept in the log information of a scene.
    For some, I can see a lot of history. For some scene's, only some hors. Is it row based, size based, time based?

    thanks.

     

    To be honest... I don't know, and I try to keep the debug log as clean as possible. I do understand your question. An I've wondered too, how the cleanup really works. If I want to debug a really nasty problem, then I resort to sending mails to myself. It would be nice if one could write a line to the event log (for durability) but as far as I know that isn't possible. Some users have suggested setting up a logging service, then using the http clients in VD and scene to log data.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @petergebruers ok thanks. If you even don't know ! An event log or export should be welcome. But exporting through a VD and scene seems overkill.

    Link to comment
    Share on other sites

    • 0

    oh well, if the buffer is full, it will be overwritten, don't remember the size (number of lines) but you can check it easily. 

     

    Regards overkill, well, make one scene which runs cyclic, reads all debug messages from all the other scenes and send it somewhere

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
    25 minutes ago, tinman said:

    oh well, if the buffer is full, it will be overwritten, don't remember the size (number of lines) but you can check it easily. 

     

    Regards overkill, well, make one scene which runs cyclic, reads all debug messages from all the other scenes and send it somewhere

     

    Please login or register to see this code.

     

     

    Thanks, I may have a use for this :-)

     

    Link to comment
    Share on other sites

    • 0

    @wpeeters

    As usual, Fibaro lacks information. 

     

     I have implement log to syslog to make sure the logs are stores according to my rules and outside the HC2. Then there is no problem. You can see what I have done if you are interested to implement anything similar.

    Please login or register to see this link.

     

    Just a few functions and you can send like this:

    if DEBUG >=1 and SYSLOG == 1 then syslogserver('User closing - Partition: ' .. part .. ' User: ' .. user) end

    instead of this:

    if DEBUG >= 1 then fibaro:debug('User closing - Partition: ' .. part .. ' User: ' .. user) end
     

     

    It its easy. You only have to start up a syslog service in any reachable server in any OS.

     

     

    Peo

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @pos, thanks. I'll take a look at it. I already have a webserver running but nevertheless, this seems to take several evenings of work again to integrate this :-)

    Link to comment
    Share on other sites

    • 0
    On 6/14/2017 at 10:43 AM, wpeeters said:

    @pos, thanks. I'll take a look at it. I already have a webserver running but nevertheless, this seems to take several evenings of work again to integrate this :-)

     

    @wpeeters

    Well. It is less than you think and not several evenings. 5 minutes work to test if you have a syslog service up and running on a remote server.

    (But *maybe* Net.FudpSocket only works in VD and the command have to be adjusted to work in a scene.)

     

    Here is a complete example...

     

    HOSTNAME = "TESTservice"
    SYSIP = "10.10.10.10"
    DEBUG = 1
    SYSLOG = 1
     
    function syslogserver(msg)
        udpsocket = Net.FUdpSocket();
        local sendmsg = (HOSTNAME .. ' ' .. msg)
        udpsocket:write(sendmsg, SYSIP, 514);

    end 

     

     

    -- with syslog
    if DEBUG >=1 and SYSLOG == 1 then syslogserver('User closing - Partition') end
     
    -- with fibaro:debug
    if DEBUG >= 2 then fibaro:debug('User closing - Partition') end
     

     

    Personally I log a lot to syslog

     

    /Peo

    Edited by pos
    Link to comment
    Share on other sites

    • 0
    On 6/13/2017 at 8:17 PM, tinman said:

    Regards overkill, well, make one scene which runs cyclic, reads all debug messages from all the other scenes and send it somewhere

     

    Please login or register to see this code.

     

    Hi @tinman, do you know if there is an equivalent to this but for VD's. I have a look at the api, couldn't find one but did find what looks like a deprecated debugscene call which leads me to believe that the api documentation is not up to date

    Edited by AutoFrank
    Link to comment
    Share on other sites

    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.

     Share

    ×
    ×
    • Create New...