From this document:
https://frappeframework.com/docs/v14/user/en/logging
It says:
At the time of writing this, only frappe.web.log and scheduler.log are logged at site and bench-level.
If I want to show controller logs at bench-level (the logs shown in console when I execute “bench start”, local development), what is the best way to do it (is there a config or something)? I know they are stored in log file, but I want all of them to show up at the console too when I develop locally.
I traced and see an option “stream_only” but the call to logger is locked to stream_only=False:
def logger(
module=None, with_more_info=False, allow_site=True, filter=None, max_size=100_000, file_count=20
):
"""Returns a python logger that uses StreamHandler"""
from frappe.utils.logger import get_logger
return get_logger(
module=module,
with_more_info=with_more_info,
allow_site=allow_site,
filter=filter,
max_size=max_size,
file_count=file_count,
)
def get_logger(
module=None,
with_more_info=False,
allow_site=True,
filter=None,
max_size=100_000,
file_count=20,
stream_only=False,
) -> "logging.Logger":
Maybe editing the Procfile or something?
Another question is if I want to set the log level for the whole app with frappe.utils.logger.set_log_level
, where is the best place to do that?
Is hooks.py
a good place? Or do I have to set it on top of each individual file that uses the logger?