How to change the log levels

Hello all

I’m facing a “TypeError: unhashable type: ‘_dict’” error when trying to import via bench data-import.

There’s no addition to my ./logs/ or ./sites/[site-name]/logs/ at the time when this error occurs.

So I assume I need to change the default INFO logging level to something such as DEBUG in order to investigate further. However, there’s no mention of how to do so in the Documentation:

https://frappeframework.com/docs/v13/user/en/logging
https://frappeframework.com/docs/v13/user/en/api/logging
https://frappeframework.com/docs/v13/user/en/basics/site_config#optional-settings-2

How do I change logging levels?

Thanks so much

1 Like

into bench_directory/common_site_config.json
Add
“logging”: 2,

the result will be all SQL query logged, about system log level I don’t know…

Thanks @FHenry

Do you know whether there are 0 and 1 levels also and if so how do they differ? What about level 3 and more? Which level changes INFO to DEBUG?

I cannot find any reference to levels in the Documentation.

@EugeneP I don’t know if Frappe framework use unix SYS_LOG flag (if that’s what your talking about). the “logging:2” into common_site_config.json take action in

frappe/database/database.py


		# info
		if (frappe.conf.get("logging") or False) == 2:
			frappe.log("<<<< query")
			frappe.log(self.mogrify(query, values))
			frappe.log(">>>>")

After that, I try to look into frappe/init.py where log method are, but I cannot find something about sys_log flag.

I don’t know how python/frappe deal with “raise Expection”, on system log