mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-12-28 22:15:40 +00:00
Introduce PDNS_ADMIN_LOG_LEVEL to change the log level
By setting the environment variable PDNS_ADMIN_LOG_LEVEL to a Python support log level, PowerDNS-Admin will use that log level.
This commit is contained in:
parent
1cd423041c
commit
0f6b7bdcf6
@ -13,8 +13,12 @@ def create_app(config=None):
|
|||||||
from .assets import assets
|
from .assets import assets
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
# Read log level from environment variable
|
||||||
|
log_level_name = os.environ.get('PDNS_ADMIN_LOG_LEVEL', 'WARNING')
|
||||||
|
log_level = logging.getLevelName(log_level_name.upper())
|
||||||
# Setting logger
|
# Setting logger
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
|
level=log_level,
|
||||||
format=
|
format=
|
||||||
"[%(asctime)s] [%(filename)s:%(lineno)d] %(levelname)s - %(message)s")
|
"[%(asctime)s] [%(filename)s:%(lineno)d] %(levelname)s - %(message)s")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user