Log: Tail possible

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Log: Tail possible

#1 Post by Micha_he » 06 Jul 2020, 11:53

Is it possible to get the x-lines (like tail) from the ESPEasy-log via web-interface ?

I've no syslog-server and if I open the log via the tools page, I see only new events and not the events some seconds before.
For troubleshooting it would be better to cache a few lines and show the cached events in front of the new ones.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Log: Tail possible

#2 Post by TD-er » 06 Jul 2020, 17:29

The log level for the web log view is dynamic.
This means even though you set it to "info" (or whatever level other then "none"), it will consider it as set to "none" unless the JSON for the web log has been queried in the last N minutes.

When creating the log entries, it is also checked to see if the log level is active for that output and if not, it will not even generate the logs.

So no, unless you have polled the web log viewer in the last N minutes, there simply is no older log entry for the web log viewer.

Later I plan on keeping the same buffer for all log outputs, but right now we don't have it.
Also with a shared buffer object, the entries should also be deleted as soon as they are read by all "subscribed" readers, or timeout.

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Log: Tail possible

#3 Post by Micha_he » 07 Jul 2020, 08:06

Ok, than I need another solution to catch my sporadic problem.

User avatar
Ath
Normal user
Posts: 3419
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Log: Tail possible

#4 Post by Ath » 07 Jul 2020, 13:07

Well, you can open an extra browser-tab with the log, and do your action(s) in the initial tab, the log-update should continue
/Ton (PayPal.me)

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Log: Tail possible

#5 Post by Micha_he » 07 Jul 2020, 14:01

Yes, but the error appears only every few days...

and a 'tail' like solution should display the log-entrys after a boot sequence ;)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Log: Tail possible

#6 Post by grovkillen » 07 Jul 2020, 14:31

You could use a computer with tftpd64 as a standalone exe which serves as a log server:

https://github.com/peacepenguin/tftpd64/releases
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Log: Tail possible

#7 Post by TD-er » 07 Jul 2020, 20:19

What kind of error do you have which happens so sporadically?

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Log: Tail possible

#8 Post by Micha_he » 08 Jul 2020, 08:30

I want to catch info's (date, time, duration) from a hall-sensor, whose binary signal is sporadic (2-3 a month) wrong.
But if I recognize the wrong signal, this is within a few minutes, the web-log didn't help, if it wasn't open before.
A syslog-server or the MQTT-log is sometimes only a little help, because the WLAN-Connection isn't always connected.

Don't worry, it was just an idea to buffer some (the newest) events.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Log: Tail possible

#9 Post by TD-er » 08 Jul 2020, 10:46

How do you read the Hall sensor?

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Log: Tail possible

#10 Post by Micha_he » 08 Jul 2020, 11:17

The Hall sensor (KY-024, https://www.az-delivery.de/products/hall-sensor-modul) has a 3.3V TTL output and is connected to a GPIO-pin from the ESP. Very simple...

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests