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

monitor.log : Timestamp not in friendly reading format #1474

Open
xMadNet opened this issue Oct 15, 2024 · 2 comments
Open

monitor.log : Timestamp not in friendly reading format #1474

xMadNet opened this issue Oct 15, 2024 · 2 comments
Labels

Comments

@xMadNet
Copy link

xMadNet commented Oct 15, 2024

simplemonitor 1.13.0
Linux Xpi4Test 6.6.22-v8+ #1747 SMP PREEMPT Wed Mar 27 17:04:50 GMT 2024 aarch64 GNU/Linux
Hi
In monitor.log : 1729012751 ping-ANT-PortierEcranMaison: ok (4.000s)
When -v used (so to screen ) : 2024-10-15 19:18:58 INFO (simplemonitor) monitor passed: ping-ANT-PortierEcranMaison
Is it possible to have same format in monitor.log ?

Also is it possible to write -l LOGLEVEL to monitor.log ?

BR

@jamesoff
Copy link
Owner

Hi :)

Is it possible to have same format in monitor.log

This is supposed to be configurable, but it looks like it's not covered properly in the documentation. I'll fix that.

Can you try adding

dateformat=iso8601

to your logger configuration? Something like this:

[file4]
type=logfile
filename=monitor4.log
dateformat=iso8601

Also is it possible to write -l LOGLEVEL to monitor.log

I'm not sure what you mean? Do you mean like the output printed normally for the loglevel (e.g. debug) to go to that file too? I do that just by redirecting the output from the program to a log file with a redirect or by using a service wrapped (e.g. daemontools).

@jamesoff
Copy link
Owner

Ah I found where in the docs that option is covered - it's mentioned for the logfile monitor and explained in the common options part: https://simplemonitor.readthedocs.io/en/latest/loggers.html#confval-dateformat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants