Enable Dark Mode!
what-are-debug-logs-in-odoo-19.jpg
By: Anupriya Ashok

What Are Debug Logs in Odoo 19

Technical Odoo 19 Odoo Enterprises Odoo Community

Debug logs in Odoo 19 provide detailed information about the application's activities during execution, including server processing, errors, SQL queries/methods, module loading, API calls, and overall system performance. 

Logs are one of the most valuable resources for developers and administrators as they allow them to see how Odoo operates behind the scenes so that they can troubleshoot and optimize performance.

What Is Odoo 19's Debug Log?

The Odoo debug log contains all the internal logs generated by Odoo as the application runs. These logs contain information related to:

  • The execution of server functions
  • Stack traces and error messages
  • Performance metrics and database queries
  • API calls and loading of modules

Why Are Debug Logs Important in Odoo 19?

Debug logs are critical to both development and production support.

Key Benefits of Odoo Debug Logging:

  • Error Tracking - Helps identify the root cause of errors and exceptions.
  • Performance Monitoring - Makes it easier to locate the cause of slow database queries and long-running processes.
  • Debugging of Modules - Useful for understanding the function of custom modules and server actions.
  • Security Evaluation - Use to identify suspicious activity (failed logins), as well as abnormal request patterns.
  • Monitoring of the System - Provides visibility on how Odoo modules and services work together.

What Information is Present in an Odoo Debug Log?

The Odoo debug log could contain:

  • Execution details of server operations
  • Method Calls and workflow activity
  • Python stack traces and error information
  • SQL queries executed against the database
  • API requests sent and responses received
  • Module installation/loading information
  • Activities relating to user logins/accessing data

Example log entry:

2026-03-18 10:15:32,123 INFO db_name odoo.addons.base.models.ir_model: Model loaded successfully
2026-03-18 10:15:33,456 DEBUG db_name odoo.sql_db: query: SELECT * FROM res_users

How to Enable Debug Logs in Odoo 19?

The debug logs feature can be enabled in Odoo 19 in various ways depending on the deployment method. 

Method 1: Using Command Line

Run Odoo with debug log level:

./odoo-bin --log-level=debug

Other useful levels:

  • info - Default logging level
  • debug - Detailed system operations
  • debug_sql - Includes SQL queries
  • warning - Only warnings
  • error - Only errors
  • critical - Critical issues only

Method 2: Configure in Odoo Configuration File

Edit your odoo.conf file:

[options]
log_level = debug
logfile = /var/log/odoo/odoo.log

Restart Odoo after making changes.

Method 3: Debug Mode from UI (Developer Mode)

  • Go to Settings
  • Click Activate Developer Mode
  • This enables technical debugging features (not full logs, but helpful for UI debugging)

Types of Debug Logs in Odoo 19:

1. Standard Debug Logs

  • General system operations
  • Function calls and workflow execution
2026-03-18 10:15:32,123 INFO db_name odoo.addons.base.models.ir_model: Model loaded successfully
2026-03-18 10:15:34,678 INFO db_name odoo.http: HTTP request handled successfully
2026-03-18 10:15:35,901 DEBUG db_name odoo.addons.sale: Processing sale order confirmation

2. SQL Debug Logs

  • Shows all database queries
  • Enabled using: --log-level=debug_sql
2026-03-18 10:15:33,456 DEBUG db_name odoo.sql_db: query: SELECT * FROM res_users
2026-03-18 10:15:36,112 DEBUG db_name odoo.sql_db: query: INSERT INTO sale_order (name, amount_total) VALUES ('SO001', 500.00)
2026-03-18 10:15:37,250 DEBUG db_name odoo.sql_db: query: UPDATE sale_order SET state='confirmed' WHERE id=42

3. Error Logs

  • Captures exceptions and failures
  • Useful for troubleshooting crashes
2026-03-18 11:10:45,678 ERROR db_name odoo.http: Exception during request handling
Traceback (most recent call last):
 File "/odoo/http.py", line 2040, in _dispatch
   result = request.dispatch()
 File "/odoo/http.py", line 2200, in dispatch
   response = self._call_function(**self.params)
 File "/odoo/addons/web/controllers/main.py", line 1350, in call_button
   action = self._call_kw(model, method, args, kwargs)
 File "/odoo/addons/sale/models/sale_order.py", line 250, in action_confirm
   raise ValueError("Invalid order")
ValueError: Invalid order

4. Access Logs

  • Tracks user login/logout and actions
2026-03-18 12:01:10,234 INFO db_name odoo.http: 192.168.1.10 - - [18/Mar/2026 12:01:10] "POST /web/session/authenticate HTTP/1.1" 200 - Login successful
2026-03-18 12:02:15,567 INFO db_name odoo.http: 192.168.1.10 - - [18/Mar/2026 12:02:15] "GET /web/dataset/search_read HTTP/1.1" 200 - Fetch records
2026-03-18 12:05:45,890 INFO db_name odoo.http: 192.168.1.10 - - [18/Mar/2026 12:05:45] "POST /web/session/logout HTTP/1.1" 200 - Logout successful

Where to Find Debug Logs in Odoo 19?

Depending on how you set things up, you can find logs in different places:

  • Log File
    • Example: /var/log/odoo/odoo.log
  • Terminal Output
    • When running Odoo manually
  • Odoo.sh Logs
    • Available in the platform dashboard
2026-03-18 10:15:32,123  INFO db_name odoo.addons.base.models.ir_model: Model loaded successfully
2026-03-18 10:15:33,456 DEBUG db_name odoo.sql_db: query: SELECT * FROM res_users

This shows:

  • Timestamp
  • Log level
  • Module
  • Message

Best practices for using debug logs:

  • Only use debug_sql when necessary
  • Avoid using debug in production for a prolonged period of time
  • Keep monitoring the log size
  • Maintain log rotation

Problems that can be solved by debug logs:

  • Errors while installing modules
  • API issues
  • Business logic errors
  • Bottlenecks
  • Database problems

In Odoo 19, debug logs are very beneficial for monitoring activities happening behind the scenes in your system. They provide an entirely clear view of how the system operates (including any errors) and offer assistance when resolving errors and developing new functionalities. Developers can quickly identify, fix, improve, and ensure efficient operation of the system by appropriately using log levels and properly managing logs; however, excessive use of debug logging in production environments may incur excess performance costs.

To read more about Overview of Debugging in Odoo 19, refer to our blog Overview of Debugging in Odoo 19.


Frequently Asked Questions

What is the difference between debug and debug_sql in odoo?

In odoo, debug mode and debug_sql mode have significant features. The difference between them lies mostly in the details that are logged. In debug mode, basic debugging information will still be visible (the execution of methods, how the system was processed, and what operations took place internally) vs. in debug_sql mode, where you will also see all of the SQL statements executed by the database along with all of the other information that is logged. Debug_sql mode will therefore be the best choice for performance analysis and troubleshooting the database.

How do you enable debug logs in production?

Yes, you can enable debug logs in production. However, you should only do so for a limited period of time. Using debug logs constantly will slow down your system and also cause the log file to become excessively large.

How are logs stored in Odoo?

Odoo defaults to displaying log information to the terminal. If there is a log file, the information will be written there as well. Odoo.sh, like many other cloud-based platforms, has a "dashboard" that can be used to view the log files that have been generated in the cloud. When there is a log file configured, it will be written to that file, and you can also view the logs on the dashboard from the Odoo.sh cloud service.

How to decrease the size of logs in Odoo?

Creating log files by using rolling logs is one of the best ways to decrease the overall size of log files. In addition to setting the log level to be only "info", which limits the information being recorded in the logs, regular deleting or archiving of old log files will also assist in limiting total disk space taken up by log file storage.

If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



Recent Posts

whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message