[Kimchi-devel] [Wok][RFC] Option to specific logging levels #35

Aline Manera alinefm at linux.vnet.ibm.com
Tue Jan 24 12:32:01 UTC 2017


Hi Ramon,

On 01/19/2017 04:28 PM, Ramon Medeiros wrote:
>
> Propose: support different levels of logging on wok
>
> Bug: wok is setting logging handlers only, not cherrypy handlers.
>
>
> Issues:
> After my troubleshooting, just saw that we need to set cherrypy handlers:
> --- a/src/wok/server.py
> +++ b/src/wok/server.py
> @@ -120,6 +120,7 @@ class Server(object):
>                                                  delay=1)
>          h.setLevel(logLevel)
>          h.setFormatter(cherrypy._cplogging.logfmt)
> +        cherrypy.log.access_log.setLevel(logLevel)
>
>          # Add access log file to cherrypy configuration
>          cherrypy.log.access_log.addHandler(h)
> @@ -128,6 +129,7 @@ class Server(object):
>          h = SafeWatchedFileHandler(options.error_log, 'a', delay=1)
>          h.setLevel(logLevel)
>          h.setFormatter(cherrypy._cplogging.logfmt)
> +        cherrypy.log.error_log.setLevel(logLevel)
>
>          # Add error log file to cherrypy configuration
>          cherrypy.log.error_log.addHandler(h)
>
>
>
> When testing, got this output:
>
> Running with loglevel == debug
> command-line ./src/wokd: No output
>
> access_log: lot of output, info output and commands results
>
> error_log: debug info
>
> ------------------------
>
> Running with loglevel == info
> command-line ./src/wokd: No output
>
> access_log: lot of output, info output
>
> error_log:  info
>
> --------------------------------
>
> Running with loglevel == error
> command-line ./src/wokd: Info output (no expected)
>
> access_log: just calls to the urls
>
> error_log: only error
>
>
> The last one was not expected :(
>

I am not sure what was not expected. Could you clarify?

> -- 
>
> Ramon Nunes Medeiros
> Kimchi Developer
> Linux Technology Center Brazil
> IBM Systems & Technology Group
> Phone : +55 19 2132 7878
> ramonn at br.ibm.com  
>
>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20170124/80b4164b/attachment.html>


More information about the Kimchi-devel mailing list