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

Output logs in docker logs #254

Closed
hoshsadiq opened this issue May 29, 2020 · 2 comments
Closed

Output logs in docker logs #254

hoshsadiq opened this issue May 29, 2020 · 2 comments

Comments

@hoshsadiq
Copy link

Is there a way to get the docker logs command to behave as expected when using docker logs with other containers?

Specifically, I'm trying to run Kodi, which currently doesn't output anything to stdout, meaning running docker logs will result in no logs. I'm trying to address this by forcing the output of Kodi's real logs into /dev/stdout (see below). This causes the logs to come up when running the x11docker command, but not when running docker logs. In general Docker picks up all output to stdout and stderr and outputs that when running docker logs.

The code snippet is as follows. This is run just before running Kodi in the entry-point.sh.

tail -F "$HOME/.kodi/temp/kodi.log" &

exec 1<&-
exec 2<&-
exec 1>>/dev/stdout
exec 2>/dev/stdout
@mviereck
Copy link
Owner

I can confirm that docker logs gives no output. x11docker does a lot of redirection to grab container output, so docker logs does not get it.
I'll have a look how to improve this.

@mviereck
Copy link
Owner

mviereck commented Jun 7, 2020

I did some changes that allow docker logs to show the container output.
The changes need some further tests, e.g. on MS Windows, but basically it should work.
Please try out and report issues if something comes up.

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

No branches or pull requests

2 participants