-
Notifications
You must be signed in to change notification settings - Fork 49
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
Use stdout/stderr instead of logs #29
Comments
Sorry for the delay with this answer. We have been rethinking some parts of this project and we missed to keep the track of the issues. I'm not sure I agree. It's true that docker recommends it and I see benefits in stdout/stderr (basically for devOps getting "docker/docker-compose logs" command), but setting bind volumes for logs is not a bad practice: allows you more control over the space they consume (or where are placed), is ready for complex architectures (share between multiple containers or NFS) and (probably more important to me) keep logs segmented (instead of getting a mess of info when things are quite verbose)... With our existing structure, you can easily check the log you like. Do you mind to argue a little more your petition. Cheers, |
Hi,
This is something that your logging system should take care of. It does not really matter if the application is running in a container or not.
In complex architectures you do not want to setup a volume for each container just to do logging and configure your logging software to harvest all the files, trying to parse information about the timestamp (which can be missing or printed in a different format, or with the wrong time zone), copy everything and repeat the harvesting regularly. Think about doing that for some hundreds of containers and then setting up another service which should read all the volumes to do harvesting in different ways.
You do not usually want to share volumes containers with logs across containers for security reasons.
You often do not control the underlying operating system when deploying containers (and you do not even want to usually).
I am not sure if you mean keeping messages belonging to different processes in different places or if you refer to log rotation. If it is the first, that is something that should not happen, as each container should run a single process (or a group of homogeneous processes) in general, as you want to decide what to do when a task fails, which is set by a policy on the container, instead of having an init system inside the container which makes everything opaque and has its own policies. I know that there are Dockerfiles around where people pack together a web server, a database and other things, but that is unmaintainable, and you do not deploy in a production system usually. If you were referring about log rotation, that is again something that logging system should take care of. What is usually done, is to choose an appropriate logging driver for Docker, toallowing tools like systemd-journald or graylog or fluentd or your preferred solution, to handle the logs.
That's valid also valid for Docker (no need to specify any path): https://docs.docker.com/engine/reference/commandline/logs/#options |
Writing to let you know that I didn't forget about this. :-) Cheers, |
@frafra probably I will have some time during the xmas vacations to take a look to this. But once I start working, I had doubts: What logs need to be redirected: error, access or both? I'm full convinced about error logs, but not as sure about access ones as far as I don't know if OJS will be able to reach them (need to check how OJS capture it) and they could be so big (and docker is usually installed in root so it could lead to issues). Happy new year, |
Both.
What about using a couple of environmental variables to set where stdout and stderr should be written to? Users could then decide to save them to a file or to /dev/stdout and /dev/stderr for example, or a mix of the two.
Happy new year! |
I can try to make a PR based on my last message, if no one is willing to take this :) |
I am just using these lines in
I execute the container using |
Hi @frafra We are moving to multi-stage and adding extra features this repository is kind are frozen. Some months ago we started to test gitLab ci/cd pipelines and right now images are generated from there. BTW, good timing for a PR as far 3.4 will be released soon. For your information, as far as you participated in the RFC post, let me say that we are actively working in making better images for OJS, OMP and OPS. We sort all the feedback we got in this document that aims to be the guide for the new oxs images: This "frame" document will be published soon to the community, and your comments are always welcome. Take care, |
Thanks for sharing such information. |
|
Hi @frafra New 3.3.0-14 image created and pushed to dockerHub right now with your PR proposal. I don't have time right now to test this new image (will don next week or so)... but if you did and find any trouble, plesae let me know. |
Hummm... too much changes and build failed: Will need to review it in detail. |
Ok... there was an issue when running "node run build". Please, let me know if you find any issue. |
Using stdout/stderr in containers instead of using volumes is a good practice as it simplifies monitoring, especially across multiple services.
The text was updated successfully, but these errors were encountered: