fix: Log site only if exists
This commit is contained in:
parent
9445c115ec
commit
4b93f75eba
2 changed files with 4 additions and 4 deletions
|
|
@ -99,9 +99,8 @@ def application(request):
|
|||
frappe.monitor.stop(response)
|
||||
frappe.recorder.dump()
|
||||
|
||||
_site = get_site_name(request.host)
|
||||
frappe.logger("frappe.web", allow_site=_site).info({
|
||||
"site": _site,
|
||||
frappe.logger("frappe.web", allow_site=frappe.local.site).info({
|
||||
"site": get_site_name(request.host),
|
||||
"remote_addr": getattr(request, "remote_addr", "NOTFOUND"),
|
||||
"base_url": getattr(request, "base_url", "NOTFOUND"),
|
||||
"full_path": getattr(request, "full_path", "NOTFOUND"),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from six import text_type
|
|||
|
||||
# imports - module imports
|
||||
import frappe
|
||||
from frappe.utils import get_sites
|
||||
|
||||
|
||||
default_log_level = logging.DEBUG
|
||||
|
|
@ -33,7 +34,7 @@ def get_logger(module=None, with_more_info=False, allow_site=True, filter=None,
|
|||
|
||||
if allow_site is True:
|
||||
site = getattr(frappe.local, "site", None)
|
||||
elif allow_site:
|
||||
elif allow_site in get_sites():
|
||||
site = allow_site
|
||||
else:
|
||||
site = False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue