diff --git a/docs/ENVIRONMENT.rst b/docs/ENVIRONMENT.rst index 7f78db30..6df2ae38 100644 --- a/docs/ENVIRONMENT.rst +++ b/docs/ENVIRONMENT.rst @@ -11,6 +11,8 @@ Global/Universal - **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 `_) +- **PATRONI\_REQUESTS_LOGLEVEL**: sets the logging level for all HTTP requests e.g. Kubernetes API calls (see `the docs for Python logging `_) Bootstrap configuration ----------------------- diff --git a/patroni/__init__.py b/patroni/__init__.py index 6bc56396..40801f65 100644 --- a/patroni/__init__.py +++ b/patroni/__init__.py @@ -135,8 +135,10 @@ class Patroni(object): def patroni_main(): logformat = os.environ.get('PATRONI_LOGFORMAT', '%(asctime)s %(levelname)s: %(message)s') - logging.basicConfig(format=logformat, level=logging.INFO) - logging.getLogger('requests').setLevel(logging.WARNING) + loglevel = os.environ.get('PATRONI_LOGLEVEL', 'INFO') + requests_loglevel = os.environ.get('PATRONI_REQUESTS_LOGLEVEL', 'WARNING') + logging.basicConfig(format=logformat, level=loglevel) + logging.getLogger('requests').setLevel(requests_loglevel) patroni = Patroni() try: