Logger in odoo helps to track data and processing system to debug at better level. In odoo to monitor critical data or payment processing or any other integration of system, logger helps best.


How to import ?

# -*- coding: utf-8 -*-
from odoo import api, models,fields
from odoo.exceptions import UserError
from odoo import exceptions
import logging
_logger = logging.getLogger(__name__)
class MySale(models.Model):
_inherit = "sale.order"


How to print ?

_logger.debug("This is my debug message ! ")

Where can I see ?

In server log,

tail -f /var/log/odoo/odoo-server.log

Or incase you run server inline, messages will come in terminal.