-
Notifications
You must be signed in to change notification settings - Fork 90
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 time stamp to logs #40
Conversation
Sorry, but I just noticed the older PR for adding time stamps. When I do a docker logs shepherd I don't get any timestamps and docker doesn't add them so this is really useful for me. I also have code to set the timezone through an env variable if you add timestamps. |
@jnk5y If you use I would prefer not to add functionality which docker itself provides as well. |
Docker will only show logs in UTC and with this PR along with some more code I have you can have logs in your preferred timezone. Up to you of course. |
Not sure. I think I'd rather have this configurable (and disabled by default) via a separate variable. That'd be the chance to add a |
Yeah, I can tackle that. I can also add a verbose option for those who want all the logs. |
What exactly do you mean with all the logs? That we make the current logging optional? |
Minimum logs would be when shepherd updates a service. Verbose would be everything else. If you have 10 services and they are all checked every 5 minutes that's 288*10 logs every day saying a service update was attempted. I really only care to know when an update occurred. I'm happy to make verbose mode the default. |
That sounds good to me. Go ahead! |
Log function which takes the log and whether it is considered a verbose mode log. If it is a verbose log and verbose mode is false it will NOT print the log. If verbose mode is true it will print all logs. Also using a timezone environment variable to set the timezone file at /etc/timezone.
…logging variables
…logging variables
I created a logging function and added a verbose logging mode. I also set the timezone from an environment variable. I also moved your environment variables from your dockerfile to the docker-compose file so they are easier to update. I have some merge conflicts that I can't quite fix myself if you could assist. |
@jnk5y Please leave the environment variables in the Dockerfile as well. They are serving as defaults so people do have to set each of them explicitely (e.g. when running without Docker Compose). Their values can be overridden in the compose file either way. |
Done |
Didn't notice the original environment section when adding the new variables
Everything should now be resolved. Sorry I'm new at this so not sure if i'm doing things the right way. |
@jnk5y Thanks! I think we can remove the write to /etc/timezone, as stated above? |
Tested without setting /etc/timezone and it worked so I removed it. |
No description provided.