Logging events can significantly improve the debugging experience. Frappe's development and production environments come with logging capabilities out of the box.
There's two main categories of logs based on accessibility. Desk Logs, which are stored in your site database and can be accessed and queried as Documents and the Server Logs, that are stored in files managed by a Log Rotation system.
Logs that can be accessed via the Desk UI (generally searched for, from the Awesomebar). These track the operational events generally; but you can utilize their APIs to track about anything from your Frappe apps.
Some of the logs in the
Core module are:
You can find more information about them from the embedded links. The best way to find out more about each of them is checking them out directly on your site.
Server Logs generally consist of lower level, transactional data as compared to those accessible from Desk. From Version 13, logs are available at site level too. These site logs are created by the Frappe Application, while many of the bench level log files are generated by the processes that support your Frappe environment. From your bench folder, you may find logs under:
At the time of writing this, only
scheduler.log are logged at site and bench-level. At bench level, some of the most useful files could be:
Note: To enable Frappe Web Logging on your site, update the site config with
Server Logs may be generated by the bench CLI, your process manager or the Frappe application directly. Your process managers take care of getting all the moving parts up and running for your Frappe environment as well as directing output and error streams to your log files.
Apart from the "always running" default logging, you can also use Monitor to log more information about all the requests to your site.
The log files generated by your process manager may get pretty large over time if you aren't paying attention. To know which files you have to track for this, checkout the
Procfile on your bench, depending on whether you're running a production or development instance respectively.
In a production environment, you'd likely want to log more information for your Frappe Applications or the processes that make up your Frappe Environment. Here's some resources you could go over to find out more.