Logging does not work

I use standard logging configurations, install in the settings.py file and get access to them in the program, but I get an error

Error for registrar not found.

It works when starting from the console, but does not work when starting from Eclipse.

The code is as follows:

import logging from config import settings logger = logging.getLogger('engine') class ReplyUser(object): def __init__(self): logger.info("Initalizes ReplyUser") def myfun(self): logger.info("Hi") print "hi" 
+4
source share
1 answer

I assume that the problem is in the PATH that eclipse uses and it cannot find settings.py, because the handler information is stored in the settings.py file, hence the error.

0
source

Source: https://habr.com/ru/post/1393784/


All Articles