-
Notifications
You must be signed in to change notification settings - Fork 147
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
Include datetime in httpok and memmon script logs #75
base: main
Are you sure you want to change the base?
Conversation
There is a setuptools error on the python 3.2 tests, that seems to be unrelated to superlance... |
This addresses #71 |
@erral thanks for addressing this! wouldn't be better to test the presence of the time stamp using assertRegexpMatches? |
Maybe... anyway the tests are run also for python 2.6 (https://github.com/Supervisor/superlance/blob/master/.travis.yml#L7) and according to the python docs assertRegexpMatches was introduced on python 2.7 |
can someone review this and give some feedback? @mnaberez? @tseaver? @erral what do you think on using the server locale? for instance, in one server I see this format on nginx log: if I use the code you implemented it gets printed differently: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the intent looks good.
- I would be inclined to centralize the repeated "generate a message line with datestamp" bits into methods on the
HTTPOk
andMemmon
classes, so that I could test it explicitly (the updated tests just skip over it). - Using a standard ISO format seems much more natural to me for logging than a locale-generated one.
yes it could be more natural from the programing point of view, but from the user interface perspective is confusing as I will have to do time zone conversions every time I look at the logs; add to that daylight timezones and you are creating two problems instead of solving one. |
I suggest logging timestamps the exact same way supervisord does, whatever that may be (it would be in |
here's a typical log from supervisor and seems to be using local time:
it would be interesting to add the level also. |
Useful to know when the httpOk or Memmon scripts did something, because currently they only log what the did, not when they did it.