mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Add ability to configure app logs to be written to a file (#903)
It gives users the option to send Patroni application logs to a File instead of Standard Out. There are three environment variables that can be set to enable and configure file logging. 1. `PATRONI_FILE_LOG_DIR`: Path to a directory that is writeable by the executing user. Having this variable set is what activates file logging. 2. `PATRONI_FILE_LOG_NUM`: This is a rolling file logger. This variable dictates how many log files are retained. 3. `PATRONI_FILE_LOG_SIZE`: This variable dictates the size at which the logs will roll. If `PATRONI_FILE_LOG_DIR` is not set than Patroni will log to stderr (default behavior does not change) Closes https://github.com/zalando/patroni/issues/902
This commit is contained in:
committed by
Alexander Kukushkin
parent
491f230711
commit
f3da6de129
@@ -8,11 +8,13 @@ It is possible to override some of the configuration parameters defined in the P
|
||||
Global/Universal
|
||||
----------------
|
||||
- **PATRONI\_CONFIGURATION**: it is possible to set the entire configuration for the Patroni via ``PATRONI_CONFIGURATION`` environment variable. In this case any other environment variables will not be considered!
|
||||
- **PATRONI\_FILE\_LOG\_DIR**: Directory to write application logs to. The directory must exist and be writable by the user executing Patroni. If you set this env variable, the application will retain 4 25MB logs by default. You can tune those retention values with PATRONI_LOG_FILE_NUM and PATRONI_LOG_FILE_SIZE (see below).
|
||||
- **PATRONI\_FILE\_LOG\_NUM**: The number of application logs to retain.
|
||||
- **PATRONI\_FILE\_LOG\_SIZE**: Size of log application log file that triggers a log rolling.
|
||||
- **PATRONI\_NAME**: name of the node where the current instance of Patroni is running. Must be unique for the cluster.
|
||||
- **PATRONI\_NAMESPACE**: path within the configuration store where Patroni will keep information about the cluster. Default value: "/service"
|
||||
- **PATRONI\_SCOPE**: cluster name
|
||||
- **PATRONI\_LOGLEVEL**: sets the general logging level (see `the docs for Python logging <https://docs.python.org/3.6/library/logging.html#levels>`_)
|
||||
- **PATRONI\_REQUESTS_LOGLEVEL**: sets the logging level for all HTTP requests e.g. Kubernetes API calls (see `the docs for Python logging <https://docs.python.org/3.6/library/logging.html#levels>`_)
|
||||
|
||||
Bootstrap configuration
|
||||
-----------------------
|
||||
|
||||
Reference in New Issue
Block a user