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

stdout/stderr to log #1531

Open
1 task done
Anagastes opened this issue Nov 17, 2021 · 4 comments · May be fixed by #1760
Open
1 task done

stdout/stderr to log #1531

Anagastes opened this issue Nov 17, 2021 · 4 comments · May be fixed by #1760
Labels

Comments

@Anagastes
Copy link

Welcome

  • 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 :)

@ldez ldez added the area/cli label Nov 17, 2021
@dmke
Copy link
Member

dmke commented Dec 30, 2021

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

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

@bpereto
Copy link

bpereto commented Feb 14, 2022

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?

@skrivy
Copy link

skrivy commented May 26, 2022

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.

@hubertbanas
Copy link

Are there any chances to get it implemented?

d0m84 added a commit to d0m84/lego that referenced this issue Nov 22, 2022
I'm not an experienced Go developer, but it seems to work and fixes [go-acme#1531]
@d0m84 d0m84 linked a pull request Nov 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

6 participants