Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Logging console message to syslog #1194

Closed
ranma opened this issue Aug 24, 2024 · 8 comments
Closed

[Request] Logging console message to syslog #1194

ranma opened this issue Aug 24, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@ranma
Copy link

ranma commented Aug 24, 2024

Is your feature request related to a problem? Please describe.

Grabbing log messages from the web UI is cumbersome and I'd like to have a continuously running log sink.

Describe the solution you'd like

It would be nice if a syslog address could be configured and console message could be sent to a syslog-compatible sink in addition to the web UI.
https://datatracker.ietf.org/doc/html/rfc5424

Describe alternatives you've considered

Send log messages over MQTT

Additional context

Syslog is a commonly-supported logging destination for embedded systems

@ranma ranma added the enhancement New feature or request label Aug 24, 2024
@AndreasBoehm
Copy link
Member

I was thinking about the same thing but i dont see that a lot of people will use that to be honest.

@ranma
Copy link
Author

ranma commented Sep 15, 2024

Upstream issue: tbnobody#1819

Upstream pull request: tbnobody#2280

@stefan123t
Copy link

@ranma thanks for implementing this. I did not spot your earlier issue downstream, sorry.

@schlimmchen
Copy link
Member

I was thinking about the same thing

Me, too.

but i dont see that a lot of people will use that to be honest.

I think that four people is far enough 😁

The upstream PR is ready, is it not? Can you rebase that branch onto our development branch and open a PR? If this "just works", I am happy to merge it. I guess you have to put in some work as MessageOutputClass looks very different in the upstream?

I would be oven more interested in logging the serial console itself, as it (and only it) includes backtraces, but even the log should be interesting.

@schlimmchen
Copy link
Member

I did some very limited research and it turns out that, despite its drawbacks, syslog seems to be the best option for this purpose. I wan concerned that we should not introduce such old and untrusted stuff, but I guess it's the best option? Please tell me if you think otherwise.

@ranma
Copy link
Author

ranma commented Sep 20, 2024

I would be oven more interested in logging the serial console itself, as it (and only it) includes backtraces, but even the log should be interesting.

You can hook the system log messages by calling esp_log_set_vprintf, but then you have to be careful to avoid deadlocks in case esp_log_set_vprintf is called again during your logging handler.

@ranma
Copy link
Author

ranma commented Sep 20, 2024

The upstream PR is ready, is it not? Can you rebase that branch onto our development branch and open a PR? If this "just works", I am happy to merge it.

Done.

@ranma
Copy link
Author

ranma commented Sep 28, 2024

Fixed in 20159f3

@ranma ranma closed this as completed Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants