-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add option, to log to file #1933
Comments
I don't see the underlying issue. Currently a no as of following reasons:
|
I don't understand what you mean?
As mentioned above this is common for dockerised apps, to write to stdout and/or file Nonetheless, thanks for considering it. |
I don't follow? |
Hi @anbraten You closed this issue but I don't understand your reply? Do you mind elaborating, or reopening? |
so if we would add some and if set, instead of stdout it will print to mentioned destination? |
That would be awesome. Some apps log only to stdout, some only to file and some to both. I think "either or" is good enough. Your Something interesting that traefik (or gitea, I can't remember) does: if you log to file instead of stdout, it logs a few lines to stdout anyway, like this:
So if someone checks the docker logs, he won't be confused why they're empty. |
Aaaah, I just realised that it's not as simple as initially thought - there's another item to consider. If the app receives a So maybe this is a long-term backlog item. |
-> #2115 |
close #1933 --------- *Sponsored by Kithara Software GmbH*
Clear and concise description of the problem
BACKGROUND
Woodpecker seems to log to
stdout
only, and thus to docker's built-in "json driver". The logs can be access like so:$ docker logs -t $CONTAINER_NAME
tail -f /var/lib/docker/containers/$CONTAINER_ID/$CONTAINER_ID-json.log
PROBLEM
When the container is recycled, the logs are lost. The workaround is to use another logging tool, but that is unnecessary complexity, especially for small deployments.
Also, in general, the logs are not in a friendly format - it's much simpler, especially in small deployments, to simply have the log in a file that can be easily manipulated. Not everyone uses large complex logging apps and servers, etc.
Suggested solution
SOLUTION
Many apps have an option to log to file as well. Gitea does that, for example.
It would be nice if the log could be sent to a file instead of (or in addition to) stdout. If enabled, it could be written to
/var/lib/woodpecker/app.log
by default.Personally, I would mount it as
/var/log/woodpecker.log:/var/lib/woodpecker/app.log
so that I could have it on the host, and use logrotate on it.Alternative
An unnecessarily complicated environment that includes log aggregation and monitoring, and who knows what else. For small servers that is overkill and hard to manage.
Additional context
Thank you for considering it!
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: