Several enhancements to server status checking, logging and configurability#7
Conversation
|
Also, for the time being, I've kept everything backwards compatible to avoid breaking current setups.
But not required, whatsoever. |
|
After this and #6 land, I'll do the latest remaining enhancements to enable full, seamless Docker usage, while fully keeping compatibility. |
…bility: - Checker: -- Handle 'SHOW STATUS' query as a dictionary and access returned values by key. -- Move values logging under each variable, to improve traceability in case any of them is not available and execution breaks. -- Now 'lag_interval' and 'lag_duration' values are read from config keys. -- Add replication status row debug logging. -- Minor message fixes. - General: -- Some already existing config keys now are optional, with previous values as defaults. -- Logging is now also configurable: log level and log destination (file or console). -- Added a few debug-level logging here and there to help at troubleshooting. -- Config template updated as needed, adding some help.
ffc9ccb to
bd3bed7
Compare
|
Ping @mandoz , since the repo owner is an organization, and in case the notification went unnoticed. |
| import logging | ||
|
|
||
| from pprint import pformat | ||
|
|
There was a problem hiding this comment.
Missing new line before class name
There was a problem hiding this comment.
👍 I thought it was better to keep imports in the same block.
There was a problem hiding this comment.
Yes it is, you need two empty lines between the last import and the class declaration.
There was a problem hiding this comment.
There was a problem hiding this comment.
Ops! Didn't knew it. Thanks for the reference link.
| #loglevel: debug | ||
|
|
||
| # Use special filename 'stderr' to log to console instead of logging to file. | ||
| #logfile: replication.log |
There was a problem hiding this comment.
Better to configure log path in my opinion that just log file name. For example a user might want to log to /var/log
There was a problem hiding this comment.
@mandoz You mean just in the sample config value? Just change replication.log to /var/log/replication.log?
Some help text additional clarification?
Or something in the feature code/functionality?
| # Use special filename 'stderr' to log to console instead of logging to file. | ||
| #logfile: replication.log | ||
|
|
||
| #webhook_url: 'https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX' No newline at end of file |
There was a problem hiding this comment.
This is a required config for slack notifications. Why is it commented out?
Thanks for sharing this useful tool.
Based on top of #6, which I used as my dev workflow, I've done some improvements which will be useful in general and enhance running inside Docker containers.
A few more to come later.