[ckan-dev] Show log messages in commands

Stefan Oderbolz stefan.oderbolz at liip.ch
Sun Aug 25 16:44:42 UTC 2013


Hi there,

I have a little problem: I use a module in a harvester. This module
contains some calls to "log.debug()". When I'm running the harvester
(ckanext.snl.harvester) I see these messages, everything is fine.

But when I use the same module (ckanext.snl.helper) with my custom command
(extending CkanCommand) I don't see the output.

I checked the "Logging" chapter in the pylons documentation (
http://pylonsbook.com/en/1.1/logging.html), but it didn't really help me.
The default settings from CKAN for logging contain a seperate logger for
"ckanext":

[logger_ckanext]
level = DEBUG
handlers = console
qualname = ckanext
propagate = 0

And if I understood the concept of the pylons logger, then both, the
harvester and my custom module, should be covered by this logger as they
are in my package "ckanext.snl.harvester" and "ckanext.snl.helper", hence
they are both in the hierarchy of "ckanext".

I initialize the logger in each file using the following:

import logging

log = logging.getLogger(__name__)


I couldn't find any special code in the harvester command from
ckanext-harvest that would explain the different behaviour, so I guess it's
a silly configuration issue. I would appreciate any hint.

Regards Stefan

-- 
Liip AG  //  Feldstrasse 133 //  CH-8004 Zurich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130825/4cfa205a/attachment.html>


More information about the ckan-dev mailing list