lego icon indicating copy to clipboard operation
lego copied to clipboard

stdout/stderr to log

Open Anagastes opened this issue 2 years ago • 4 comments

Welcome

  • [X] Yes, I've searched similar issues on GitHub and didn't find any.

How do you use lego?

Binary

Detailed Description

I am using the current LEGO port for mips and have now tried with logger and tee to log the bash output for later error analysis in case of problems.

But LEGO doesn't seem to output a classic stdout/stderr and I can't catch the output.

If there is no other way technically, a logging function would be nice :)

Anagastes avatar Nov 17 '21 18:11 Anagastes

Lego logs to stderr. To capture logs through tee, you need to redirect that output:

$ lego ... 2>&1 | tee -a lego.log

dmke avatar Dec 30 '21 13:12 dmke

I would like to see the standard behaviour, that errors go to "stderr" and info and related to stdout.

You can take advantage to cron with filtered stdout but enabled errors to receive an email with the error message when a error is logged on stderr. Or any other ideas, how "email me when error" could be done with lego (without a huge wrapper script) ?

My knowledge in go is limited - but it seems new logger instance is needed?

bpereto avatar Feb 14 '22 07:02 bpereto

I support this. Errors are supposed to go to the stderr and stdout is for the rest.

for example - this message goes to stderr, but it is expected behavior.

2022/05/26 21:41:37 [domain.tld] The certificate expires in 89 days, the number of days defined to perform the renewal is 30: no renewal.

skrivy avatar May 26 '22 19:05 skrivy

Are there any chances to get it implemented?

hubertbanas avatar Sep 30 '22 11:09 hubertbanas