<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 01/27/2017 04:02 PM, Ramon Medeiros
      wrote:<br>
    </div>
    <blockquote
      cite="mid:7a35a6db-1f7c-7e8e-9b64-4cea4473b9ce@linux.vnet.ibm.com"
      type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <p><br>
      </p>
      <br>
      <div class="moz-cite-prefix">On 1/24/17 10:32 AM, Aline Manera
        wrote:<br>
      </div>
      <blockquote
        cite="mid:b847afd1-6209-af9b-22f3-fa2df9e3c41a@linux.vnet.ibm.com"
        type="cite">
        <meta content="text/html; charset=windows-1252"
          http-equiv="Content-Type">
        <br>
        Hi Ramon,<br>
        <br>
        <div class="moz-cite-prefix">On 01/19/2017 04:28 PM, Ramon
          Medeiros wrote:<br>
        </div>
        <blockquote
          cite="mid:c13f54e2-ea77-5706-ec8c-30ba723d3147@linux.vnet.ibm.com"
          type="cite">
          <meta http-equiv="content-type" content="text/html;
            charset=windows-1252">
          <p>Propose: support different levels of logging on wok <br>
          </p>
          <p>Bug: wok is setting logging handlers only, not cherrypy
            handlers.</p>
          <p><br>
            Issues:<br>
            After my troubleshooting, just saw that we need to set
            cherrypy handlers:<br>
            --- a/src/wok/server.py<br>
            +++ b/src/wok/server.py<br>
            @@ -120,6 +120,7 @@ class Server(object):<br>
                                                             delay=1)<br>
                     h.setLevel(logLevel)<br>
                     h.setFormatter(cherrypy._cplogging.logfmt)<br>
            +        cherrypy.log.access_log.setLevel(logLevel)<br>
             <br>
                     # Add access log file to cherrypy configuration<br>
                     cherrypy.log.access_log.addHandler(h)<br>
            @@ -128,6 +129,7 @@ class Server(object):<br>
                     h = SafeWatchedFileHandler(options.error_log, 'a',
            delay=1)<br>
                     h.setLevel(logLevel)<br>
                     h.setFormatter(cherrypy._cplogging.logfmt)<br>
            +        cherrypy.log.error_log.setLevel(logLevel)<br>
             <br>
                     # Add error log file to cherrypy configuration<br>
                     cherrypy.log.error_log.addHandler(h)<br>
          </p>
          <p><br>
            <br>
            When testing, got this output:<br>
          </p>
          <p>Running with loglevel == debug<br>
            command-line ./src/wokd: No output</p>
          <p>access_log: lot of output, info output and commands results</p>
          <p>error_log: debug info<br>
            <br>
            ------------------------<br>
          </p>
          <p>Running with loglevel == info<br>
            command-line ./src/wokd: No output</p>
          <p>access_log: lot of output, info output<br>
          </p>
          <p>error_log:  info<br>
          </p>
          <p>--------------------------------</p>
          <p>Running with loglevel == error<br>
            command-line ./src/wokd: Info output (no expected)<br>
          </p>
          <p>access_log: just calls to the urls<br>
          </p>
          <p>error_log: only error<br>
          </p>
          <p><br>
            The last one was not expected :(<br>
            <br>
          </p>
        </blockquote>
        <br>
        I am not sure what was not expected. Could you clarify?<br>
      </blockquote>
      was not expected to see INFO log when setting to error level.<br>
    </blockquote>
    <br>
    I am not sure if the command output should be consider as a log.<br>
    From my view, the right content should be in the log files.<br>
    <br>
    The command line output should be enabled only when running with
    environment != production to make debug easier.<br>
    You can check src/wok/server.py to check that:<br>
    <br>
    <tt>        # Enable cherrypy screen logging if running
      environment                 </tt><tt><br>
    </tt><tt>        # is not
      'production'                                                   </tt><tt><br>
    </tt><tt>        if
      dev_env:                                                            
    </tt><tt><br>
    </tt><tt>            cherrypy.log.screen = True  </tt><tt><br>
    </tt><br>
    When running on production (the default mode), the command line
    output is not even shown.<br>
    <br>
    <blockquote
      cite="mid:7a35a6db-1f7c-7e8e-9b64-4cea4473b9ce@linux.vnet.ibm.com"
      type="cite">
      <blockquote
        cite="mid:b847afd1-6209-af9b-22f3-fa2df9e3c41a@linux.vnet.ibm.com"
        type="cite"> <br>
        <blockquote
          cite="mid:c13f54e2-ea77-5706-ec8c-30ba723d3147@linux.vnet.ibm.com"
          type="cite">
          <pre class="moz-signature" cols="72">-- 

Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems &amp; Technology Group
Phone : +55 19 2132 7878
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:ramonn@br.ibm.com">ramonn@br.ibm.com</a> </pre>
          <br>
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <br>
          <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>