1) Do not name your sub-package "pyramid" unless you are using "from
__future__ import absolute_import". Even then it's just prone to causing
import errors.

2) [handler_dogapi] implies that the handlers argument = dogapi, not
dogapi_handler.

3) You need a [handlers] section defining the possible handlers, such as
keys = dogapi.

4) This is pretty much all covered in
http://docs.pylonsproject.org/projects/pyramid/en/1.4-branch/narr/logging.html

HTH,
Michael


On Thu, Jan 24, 2013 at 6:16 AM, Andreas Jung <[email protected]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I added a custom logging handler to my dev.ini file:
>
> [loggers]
> keys = root, myapp
>
> [logger_myapp]
> handlers = dogapi_handler
>
> [handler_dogapi]
> class = mib.pyramid.logging.DogAPILoggingHandler
>
> This also leads to an
>
> ImportError: No module named pyramid
>
> during the Pyramid startup phase
>
> The handler itself is defined as
>
> class DogAPILoggingHandler(logging.Handler):
>    def emit(...)
>
> logging.handlers['dogapi'] = DogAPILoggingHandler
>
> Basic question is if this is the right way to configure a custom
> logging handler and why the import error occurs. The module
> should be importable, or?
>
> - -aj
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQGUBAEBAgAGBQJRASYTAAoJEADcfz7u4AZj0ccLv0aVyapimOUh3qcTHVU+7w5g
> SW+br5PzxE/kFoBB9R+EBU3JlWI2DiV3yDTCZWfsS9+cndpuQg6/vU3jZGwrJgUA
> sEd5WWL8+Be5fjv+ExiUP29lU+PDDZh1yy8RXSfVtNUZGw9eGljNBSuuyKjHhhDL
> 5A0b4OF3YX3u/WvfeC6dquwf5kviF/3QCbMrjAOQg/nrtvtqyGxnVEYfEH4axGgQ
> OCwYoNSX8p58L0Atjpwt6eX+/SrNlq9ob2+Kz/7CrppsMmiq5y+sJmq5xicD4YFq
> 1RTSofOZSFbPBL8EFL37lpLPnaz2ufbuPUwZQioMZ9WVos4sOQIsJ/+UTIuFNq+K
> Lb2Nv2A+uLrFhhJhCW1p1No+mW2uaZDxeMfjZJ0c7Bv9P8NiLjQQ8q+sJcpO9/OS
> c3rgVKqZJeB5FSqYaSkv/aSaI5/qmW0fQqOtTSVAZc9PMmyBV7JVufYxbxrIimk4
> 7iP6u0a1nIQbp4rPA4Yvd3GmnV5WDJM=
> =2Pya
> -----END PGP SIGNATURE-----
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to