1.8 API - Is it possible to pull logs?

I would like to know if it is possible to pull logs from 1.8 via the API.

I am most interested in pulling the recent display logs.

You can use GET /log and filter by displayId - sorry its not documented yet

Ah… Thank You Dan!

1 Like

Seems in RC-1 this is not working anymore. I just get an empty response. I would guess something is now required?

Edit: Looking at the code it would appear that these are the parameters for log

fromDt, toDt, type, page, channel, function, displayId, userId, excludeLog, runNo, message

I have tried some combinations to see if I could get something to work. The best I could do was to get an error about fromDt and toDt should be in a date format.

Seems to be working on my test env - i just hit /api/log and got back a bunch of stuff regarding my prior request. Are you seeing any logging in the UI?

Debug logging automatically turns off in the latest code - which might be part of the issue for you? If you want debug logging permanently on you need to switch the CMS into Test mode.

Yes I do, if I change the Interval to hours. (Tried the same on the API, no dice).

If I send a blank call to api/log I just get a blank response back. If I turn on debug logging I then see items in the UI without adjusting the Interval. But still nothing via the API when I adjust fromDt and toDt. I believe fromDt would be a date in the past, if you wanted say everything from yesterday till now.

I am sure it is on my side then, if nothing else is required, just not sure what it would be.

Not quite - if you set from date to be “yesterday” and the interface was 12 hours - you would get 12 hours of logs that happened before “yesterday”.

If you want the last 12 hours of logs you just send the seconds as 12 and the intervalType as 3600 - leave the fromDt empty.

1 Like

Ok… I will give that a go.

That seems to work great for me.

Last question/request on this.

Currently “displayId” is not returned on logs pertaining to Displays. Can this be added so that the results can be sorted easier?