[ckan-dev] Show log messages in commands

Stefan Oderbolz stefan.oderbolz at liip.ch
Sun Aug 25 21:45:09 UTC 2013


I could solve my problem by defining a custom logger in my development.ini:

[logger_helper]
level = DEBUG
handlers = console
qualname = ckanext.snl.helper
propagate = 0


This works, but I still don't know, why this was not covered by the default
"ckanext" logger and why this works when running the harvester instead of
running my own command.


On Sun, Aug 25, 2013 at 6:44 PM, Stefan Oderbolz <stefan.oderbolz at liip.ch>wrote:

> 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
>



-- 
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/40b7f346/attachment-0001.html>


More information about the ckan-dev mailing list