Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Funtion to print log message in the logfile odoo-8?

By
samba
on 1/6/15, 8:47 AM 2,142 views

HI every one in odoo-7 development, i can see print statement output in console. How can i run odoo-8 server to  see print output in console?. If not can any one suggest me  a funciont like _logger.exception() in odoo-7 to debug my code in odoo-8,  while developing module?

I think you are simply looking for the --log-level=debug when running your Odoo from terminal? This will print out all the statements in your Ubuntu terminal.

Yenthe
on 1/6/15, 9:34 AM
How can i start the odoo-8 server with the --log-level.. I tried but failed..

On Tue, Jan 6, 2015 at 8:04 PM, Yenthe <yenthespam@gmail.com> wrote:

I think you are simply looking for the --log-level=debug when running your Odoo from terminal? This will print out all the statements in your Ubuntu terminal.

--
Yenthe
Sent by Odoo S.A. using Odoo about Forum Post Funtion to print log message in the logfile odoo-8?



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)
samba
on 1/7/15, 12:44 AM

Simply open up your Ubuntu terminal and navigate to odoo/odoo-server (or however you named the structure). Then start your server with ./openerp-server --log-level=debug

Yenthe
on 1/7/15, 1:54 AM
Thank you Dinesh, I did these changes how  can i run server now?. sudo /etc/init.d/odoo-server start. When i type this there was no log generated in console

On Wed, Jan 7, 2015 at 11:52 AM, Dhinesh <dvdhinesh.mail@gmail.com> wrote:

A new answer for Funtion to print log message in the logfile odoo-8? has been posted. Click here to access the post.

--
Dhinesh



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)
samba
on 1/7/15, 1:55 AM

If you start odoo using init.d boot script, it will start as daemon process. There will be no console to print. Everything will be printed in log file specified in your configuration. Start your server like @Yenthe said, ./openerp-server --log-level=debug (Only for development purpose). You will get the message in print statement. You can also use import pdb;pdb.set_trace() in your module to debug it instead of usual print statement.

Dhinesh - Technical Consultant, Sodexis Inc
on 1/8/15, 12:28 AM
0

Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
3577
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 1/7/15, 1:22 AM

Hi, This will work depends on your log level in your configuration file.
import logging
_logger = logging.getLogger(__name__)
_logger.error('msg')
_logger.warning('msg')
_logger.debug('msg')
_logger.info('msg')
_logger.exception('Connection to the database failed''msg')

Log parameters for configuration file:
# file where the server log will be stored
logfile = None
# specify the level of the logging. Accepted values: info, debug_rpc, warn, test, critical, debug_sql, error, debug, debug_rpc_answer, notset
log_level = info
log_handler = [':INFO']

You can also give these parameters from terminal while starting your sever.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 1/6/15, 8:47 AM
Seen: 2142 times
Last updated: 3/16/15, 8:10 AM