How to understand the different logs created by frappe/bench

I am trying to debug an error that has happened to me when I was trying to follow the Frappe tutorial. Module Not Found error when following Frappe v14 Tutorial - ERPNext Forum

Ideally I want to understand what actions I have done that led to this error so that I can reproduce this error.

I have read through these resources on this topic:

  1. Logging
  2. Better Error Logging with Frappe
  3. Logging

But it is still NOT clear to me how I can get a report of all the errors that happened and possibly some clues as to the root cause.

When browsing through the logs folder, I found the following log files - some of which I can understand:

  1. bench.log → bench commands executed
  2. frappe.log → when does this log get written? Does this correspond to either Error Log or Error Snapshot? why is the frappe log written both under the bench and under the site - does the log under bench store the consolidated log across all sites?
  3. scheduler.log → does this corrrespond to redis cache server?
  4. worker.log → Procfile redirects logs from bench worker here → what does bench worker do?

Ideally, I want to look at a log that shows the commands I have executed in bench like new-app, new-site, install-app and whether they succeeded or had errors. I got my first error about Module Not Found when I tried to uncheck custom in the Article DocType about missing Module - but I am not really sure why it happened?

In my Error Snapshot, I see this error:

In my Error Log list, I see this error:

In my frappe.log, I see the following errors

2022-12-16 10:15:35,390 ERROR frappe New Exception collected with id: 2022-12-16 10:15:35.174856-127.0.0.1-3b2
Site: library.test
Form Dict: {'doctype': 'Article', 'name': 'c8a8dd49ea', 'cmd': 'frappe.desk.form.load.getdoc'}
2022-12-19 08:26:04,515 ERROR frappe Could not take error snapshot: characters_written
Site: library.test
Form Dict: {'doctype': 'Article', 'with_parent': '1', 'cached_timestamp': '', 
'cmd': 'frappe.desk.form.load.getdoctype'}

Traceback (most recent call last):
  File "/Users/siraj/Dev/frappe-bench1/apps/frappe/frappe/app.py", line 56, in application
    response = frappe.api.handle()
...
FileNotFoundError: [Errno 2] No such file or directory: 
'/Users/siraj/Dev/frappe-bench1/apps/library_management/library_management/library_management/doctype/article'

I am trying to understand what these errors mean and why they have happened. Any help from anyone would be appreciated.

1 Like