Linux新手求Ubuntu终端Odoo 10调试日志解读资源
Hey there! As someone new to Linux and Odoo, I totally get how those terminal logs can feel overwhelming at first. Let’s start by breaking down the log snippet you shared, then dive into some solid ways to learn how to read these logs better.
First, let’s look at your specific log entry:
2018-03-21 05:29:31,817 2296 DEBUG odoo odoo.api: call crm.lead().load_views(options={u'load_fields': False, u'load_filters': True, u'toolbar': True, u'action_id': 141}, views=[[347, u'kanban'], [350, u'list'], [349, u'form'], [None, u'graph'], [None, u'calendar'], [None, u'pivot'], [352, u'search']])
Here’s what each part means:
2018-03-21 05:29:31,817: The exact timestamp (down to milliseconds) when the log was generated—super helpful for tracing when an action happened.2296: The process ID (PID) of the Odoo instance running this action. You can use this to target the specific Odoo process if you need to debug or manage it.DEBUG: The log level—this is the most detailed level, used for tracking internal system actions. Other common levels areINFO(general updates),WARNING(potential issues),ERROR(failed actions), andCRITICAL(system-breaking problems).odoo odoo.api: The module/source of the log entry—this one comes from Odoo’s core API module.- The main message:
call crm.lead().load_views(...)tells you that the system is calling theload_viewsmethod on thecrm.leadmodel (which manages leads in Odoo). The parameters inside the parentheses explain what’s being loaded:options: Controls how views are loaded—load_fields: Falsemeans it’s not pulling detailed field data,load_filters: Truemeans it’s loading saved filters, etc.views: A list of all available view types for thecrm.leadmodel, with their IDs (like347for the kanban view) orNoneif the view hasn’t been assigned an ID yet.
1. Odoo Official Documentation
Odoo’s official docs have a dedicated section on logging that’s perfect for beginners:
- It breaks down log levels, their purposes, and when to expect each one.
- It explains the structure of Odoo logs in detail, so you can parse every part like we did above.
- It also covers how to configure logging (like changing log levels or saving logs to a file) which is useful for debugging.
2. Ubuntu System Log Basics
Since you’re new to Linux, getting comfortable with Ubuntu’s log ecosystem will make Odoo logs easier to handle:
- Learn about common log locations: Odoo logs usually go to either the terminal (if you’re running it directly) or a file like
/var/log/odoo/odoo.log(if it’s set up as a service). - Master basic log commands: Use
tail -f /path/to/odoo.logto watch logs in real-time as you perform actions, andgrep "ERROR" /path/to/odoo.logto filter only error messages—these are lifesavers for debugging.
3. Odoo Community Examples
The Odoo community is full of developers sharing their log debugging stories. Search for terms like "Odoo debug log explanation" or "crm.lead load_views log" in community forums, and you’ll find real-world examples where people break down similar logs. Learning from these cases will help you connect logs to actual system behavior.
4. Hands-On Debugging
Nothing beats practice! Try these small exercises:
- Enable Odoo’s debug mode (add
?debug=1to your Odoo backend URL) to get more detailed logs. - Perform simple actions like creating a lead, switching between kanban/list/form views, and then match those actions to the logs in your terminal. This will help you build intuition for what each log entry corresponds to.
内容的提问来源于stack exchange,提问作者Nugroho Widi

