[Solved] Read loglines with json command skip Status logs Topic is solved

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
User avatar
waaren
Posts: 607
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

[Solved] Read loglines with json command skip Status logs

Post by waaren » Thursday 14 June 2018 22:32

Version: V3.9639 (compiled locally)
Debian Stretch on RPI-3

I do not get any loglines starting with Status: when using domoticz_IP:domoticz_Port/json.htm?type=command&param=getlog
I do see the lines in the logfile on OS level and in the logwindow in the GUI.

Tried a couple of previous versions (until V3.9580) because I did see a recent update on logger.cpp but no result.

Should I now use an extra setting or parm to get these loglines ?
Last edited by waaren on Thursday 14 June 2018 23:48, edited 1 time in total.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

User avatar
jvdz
Posts: 1317
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Read loglines with json command skip Status logs

Post by jvdz » Thursday 14 June 2018 23:01

Looks like it defaults to level=1 log messages when the loglevel isn't provided.
Adding the loglevel allows for other messages to be retrieved like 2 for status messages:

Code: Select all

http://192.168.0.??:8080/json.htm?type=command&param=getlog&loglevel=2
Jos

User avatar
waaren
Posts: 607
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Read loglines with json command skip Status logs

Post by waaren » Thursday 14 June 2018 23:11

@jvdz,

Many thanks Jos, I could not find it !
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

User avatar
jvdz
Posts: 1317
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Read loglines with json command skip Status logs

Post by jvdz » Thursday 14 June 2018 23:16

I had to look in the source code to figure that our. ;)

Jos

User avatar
waaren
Posts: 607
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

[Solved] Read loglines with json command skip Status logs

Post by waaren » Thursday 14 June 2018 23:25

jvdz wrote:
Thursday 14 June 2018 23:16
I had to look in the source code to figure that our. ;)

Jos
That is where I initially found the getlog json from but my development system was busy doing other stuff...

I will update the JSON wiki with this information. Can you please check what the return is on your prod system if you add the &loglevel
(I do not have versions before V3.8153

Thanks !
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

User avatar
jvdz
Posts: 1317
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: [Solved] Read loglines with json command skip Status logs

Post by jvdz » Friday 15 June 2018 9:27

waaren wrote:
Thursday 14 June 2018 23:25
Can you please check what the return is on your prod system if you add the &loglevel
(I do not have versions before V3.8153
As mentioned in the other thread: There was no change in the result returned when I added it to the url on V3.8153 so we should be able to safely add it to the function and it should work for both. :)

Jos

User avatar
jvdz
Posts: 1317
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: [Solved] Read loglines with json command skip Status logs

Post by jvdz » Friday 15 June 2018 9:45

Just had a though to also check what the domoticz webpage does for log retrieval and that sends this url to retrieve all statussus in one go:

Code: Select all

/json.htm?type=command&param=getlog&lastlogtime=0&loglevel=268435455
Jos

User avatar
waaren
Posts: 607
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: [Solved] Read loglines with json command skip Status logs

Post by waaren » Friday 15 June 2018 11:16

@jvdz. thanks !

I will update the wiki and also post a question in slack or GITHub on how we can get this kind of information documented without digging in the sources or using network monitors :)
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests