-
Notifications
You must be signed in to change notification settings - Fork 533
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
Logs do not appear in docker-compose #91
Comments
Also this:
is never printed on the screen. |
Very strange, upon:
openresty spits all previous log on stdout and from there on starts sending access logs on stdout. Looks like something was cached previously. How to disable this caching? Also, ony access.log is printed, i still does not print |
Indeed, |
The Usage section of the README says:
This symlinking happens in the |
@neomantra yes, I am aware of this, and I saw that same technique is applied in official NginX Dockerfile. However - NginX logs work like a charm, everything is printed on What I am trying to do is to enable OpenResty for Mainflux IoT platform, and I just pushed the docker-compose.yml and nginx.conf on resty branch over there. |
Is it possible that docker buffers And from this restart on logging works as it is supposed. BTW, different engineers from our team thested this on different machines - same behaviour. |
What happens if you do Edit: I mean, start with |
Running container without
Error is thus either in a custom |
I was Googling a bit and it seems there's some nuance or issues with
|
I tried to use raw docker (without docker-compose) and custom
Does exactly what I need - logs all access and also logs Lua prints (which in this case print out received client certificate). I can not obtain these logs and especially this printfs from Lua even after container restart in docker-compose. I.e. after container restart in docker-copose I have access log, that logs accessed HTTP URLs, but I still do not have these nice prits from Lua that I need. |
@neomantra thanks - I would like to investigate and solve this, because we really want to use OpenResty in Mainflux and allow mTLS and full X.509 client-side cert support for MQTT and other protocols. What is strange is that official NginX image which uses the same mechianism of symlinking in the |
Fixed by mounting custom |
I have to re-open this issue. It was actually not solved when I added I have noticed that when openresty container starts before of other containers in composition, and does not find other containers from
OpenResty is set to restart on failure in docker-compose: https://github.com/drasko/mainflux/blob/resty/docker/docker-compose.yml#L22 Maybe this restart or error in |
Maybe realted to this one: docker/compose#2700 I do not understand however why mainstream NginX works in the same setup (with restart). |
Tried with latest docker-compose v1.24-rc1 - same behavior: no logs on start, then on restart logs appear. |
@neomantra I think that this might finally be a OpenResty issue. Here are the steps to recreate the issue:
In order to see logs again, you need to restart OpenResty once more, manually. Then logs will appear. I do not know what the issue might be, but the same procedure works fine with original NginX docker, as I mentioned. |
Hi @drasko, Has there been any update from your case? I happened to get into the same issue. What I did was to build a Docker image from source following Building (DEB based) with the With
I could see all the logs to |
I can confirm @Genzer 's solution works.
|
Is there a definite known once-and-for-all workaround for this that doesn't require rebuilding openresty from sources? |
It's been hard to tell what the problem actually was.... also the various software (Docker runtimes, |
Almost 2 yers later and I am seeing this problem also. |
@akuznetsov-novatus , I followed @Genzer suggestion above to use the DEB based Docker image with debug flag and could get the logs working. |
I think different people are seeing this problem for different reasons. I personally could never reproduce it. Various software has advanced since then and I am happy to look at a self-contained example again. It is weird that Some good news is that there are now debug images on Docker Hub, so you can run with |
I am runnig openresty docker from docker-compose with other services, and only openresty do not print anything on stdout.
I have no idea where
access.log
anderror.log
are going, and if they are buffered or what - but they are no printed in the logs of docker-cmpose.The text was updated successfully, but these errors were encountered: