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

log2ram #8

Closed
ei23com opened this issue Oct 27, 2019 · 5 comments
Closed

log2ram #8

ei23com opened this issue Oct 27, 2019 · 5 comments
Labels
question Further information is requested

Comments

@ei23com
Copy link

ei23com commented Oct 27, 2019

Just for understanding it right: Will it be enough to have log2ram on the root system?
Won't each container log for itself?

@gcgarner
Copy link
Owner

log2ram replaces the /var/log folder with a ramdrive then syncs those changes to disk on a schedule. This reduces the total writes to the sd card.

The containers don't log to /var/log, they log to their own internal logs

@gcgarner
Copy link
Owner

Because each container has its own log that writes to disk inside their respective container it may be worthwhile to map them securely into /var/log to get full benefit of log2ram

@gcgarner gcgarner added the question Further information is requested label Oct 27, 2019
@ei23com
Copy link
Author

ei23com commented Oct 27, 2019

That's what i was asking for, Thanks. I just getting into Docker, may i find out how to map the logs into /var/log

@gcgarner
Copy link
Owner

Each container will differ as to where they store their logs. I used the script "./services/nodered/terminal.sh" to open the shell for nodered. Doing a "ls /var/log" inside nodered shows that its "standard" log is empty. I would assume that the standard log would be empty and containers would do minimal logging.

First you would need to make a subfolder in /var/log that you want to share. Don't directly map your /var/log because you don't want to unnecessarily expose your sensitive data to a container.

If you do find the log for a container you can edit the docker-compose.yml file and under the volumes add

volumes:

  • /var/log/MYLOG:/path/to/log/inside/container

@ei23com
Copy link
Author

ei23com commented Oct 27, 2019

Thank you!

@ei23com ei23com closed this as completed Oct 27, 2019
gpongelli pushed a commit to gpongelli/IOTstack that referenced this issue Apr 21, 2020
get current user in directoryfix.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant