Looger object only prints "ERROR"s

J

Jean-Michel Pichavant

daved170 said:
hi everybody,
I took your adviced and used the logging object.
I copied the example in 16.6.15.2 - "using logging in multiple
modules" from http://docs.activestate.com/activepython/3.1/python/library/logging.html.

unfortunattly it only prints to file the ERROR level's messages and
ignore the others. I tried to change the level with SETLEVEL but it
didn't help.
Any idea? thanks,
DaveD
Diffcult to say without a bunch of code.
I would say that your FileHandler formatter has something wrong.
Please provide the code where you're adding this handler to you logger
object.
Try to change the format to "%(asctime)s - %(levelname)s - %(message)s"
for testing purpose and tell us if you still have issues.

/logging/ is the way to go, keep going :eek:)

Jean-Michel
 
J

Jean-Michel Pichavant

Jean-Michel Pichavant said:
Diffcult to say without a bunch of code.
I would say that your FileHandler formatter has something wrong.
Please provide the code where you're adding this handler to you logger
object.
Try to change the format to "%(asctime)s - %(levelname)s -
%(message)s" for testing purpose and tell us if you still have issues.

/logging/ is the way to go, keep going :eek:)

Jean-Michel
Ignore my post, I just misread your description.
Verify you don't have filters attached to your handlers.
If you have a hierarchy of loggers, make sure their level are all
correctly set
For instance if you have a 'foo.bar' logger, you may set 'foo.bar' level
to DEBUG, logs can still be filtered by 'foo' if this logger level is
still ERROR.

JM
 
V

Vinay Sajip

hi everybody,
I took your adviced and used theloggingobject.
I copied the example in 16.6.15.2 - "usingloggingin multiple
modules" fromhttp://docs.activestate.com/activepython/3.1/python/library/logging.html.

unfortunattly it only prints to file the ERROR level's messages and
ignore the others. I tried to change the level with SETLEVEL but it
didn't help.
Any idea? thanks,
DaveD

You need to post some code. I just copied and pasted that example into
app.py and auxiliary_module.py, and running it produced a spam.log
file with the expected results. So your copy must be different from
that example, and the problem will be somehow related to something
you've changed.

Regards,

Vinay Sajip
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top