mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
Bug fixes. Adjust logger
This commit is contained in:
parent
9904505867
commit
67e6df6880
@ -1,7 +1,8 @@
|
||||
import os
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
import logging
|
||||
from flask import Flask
|
||||
from flask_seasurf import SeaSurf
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
|
||||
from .lib import utils
|
||||
|
||||
@ -11,6 +12,18 @@ def create_app(config=None):
|
||||
from .assets import assets
|
||||
app = Flask(__name__)
|
||||
|
||||
# Setting logger
|
||||
logging.basicConfig(
|
||||
format=
|
||||
"[%(asctime)s] [%(filename)s:%(lineno)d] %(levelname)s - %(message)s")
|
||||
|
||||
# If we use Docker + Gunicorn, adjust the
|
||||
# log handler
|
||||
if "GUNICORN_LOGLEVEL" in os.environ:
|
||||
gunicorn_logger = logging.getLogger("gunicorn.error")
|
||||
app.logger.handlers = gunicorn_logger.handlers
|
||||
app.logger.setLevel(gunicorn_logger.level)
|
||||
|
||||
# Proxy
|
||||
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||||
|
||||
|
@ -125,7 +125,8 @@ class Record(object):
|
||||
"content": self.data,
|
||||
"disabled": self.status,
|
||||
}],
|
||||
"comments": [self.comment_data]
|
||||
"comments":
|
||||
[self.comment_data] if self.comment_data else []
|
||||
}]
|
||||
}
|
||||
else:
|
||||
@ -144,7 +145,8 @@ class Record(object):
|
||||
"ttl": self.ttl,
|
||||
"type": self.type
|
||||
}],
|
||||
"comments": [self.comment_data]
|
||||
"comments":
|
||||
[self.comment_data] if self.comment_data else []
|
||||
}]
|
||||
}
|
||||
|
||||
@ -367,8 +369,10 @@ class Record(object):
|
||||
})
|
||||
|
||||
postdata_for_new = {"rrsets": final_records}
|
||||
current_app.logger.debug(postdata_for_new)
|
||||
current_app.logger.debug(postdata_for_delete)
|
||||
current_app.logger.debug(
|
||||
"postdata_for_new: {}".format(postdata_for_new))
|
||||
current_app.logger.debug(
|
||||
"postdata_for_delete: {}".format(postdata_for_delete))
|
||||
current_app.logger.info(
|
||||
urljoin(
|
||||
self.PDNS_STATS_URL, self.API_EXTENDED_URL +
|
||||
|
@ -21,10 +21,6 @@ function applyChanges(data, url, showResult, refreshPage) {
|
||||
},
|
||||
|
||||
error : function(jqXHR, status) {
|
||||
// console.log(jqXHR);
|
||||
// var modal = $("#modal_error");
|
||||
// modal.find('.modal-body p').text(jqXHR["responseText"]);
|
||||
// modal.modal('show');
|
||||
console.log(jqXHR);
|
||||
var modal = $("#modal_error");
|
||||
var responseJson = jQuery.parseJSON(jqXHR.responseText);
|
||||
|
Loading…
Reference in New Issue
Block a user