fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] How to control paramiko logging level, when using fabric?


From: Elvinas Piliponis
Subject: Re: [Fab-user] How to control paramiko logging level, when using fabric?
Date: Thu, 28 Jan 2016 10:34:42 +0000

Hello,

Unfortunately it does not. If I set globally (I suppose)

  fabric.api.hide('everything')
  fabric.api.show('running', 'user', 'output', 'stdout', 'stderr', 'warnings', 'aborts', 'status')

I still see this SSH noise. It is not coming from Fabric itself. It is paramiko, which somehow still catches global DEBUG level.

It is not critical, but  it generates around 20 lines of noise output for 1 relelvant message, like
    [10.193.31.52] run: [ ! -d /usr/local/share/xstream/puppet ] && mkdir -p /usr/local/share/xstream/puppet || true
And for less experienced users (which we intend to give this installer) such information line is lost :)



Thank you

On 2016.01.28 11:50, Carlos García wrote:

Hi Elvinas,

read Managing output section in Fabric docs. I’m sure you will find what you need.

I use context managers to hide sensitive information:

        with fabric.api.settings(
                fabric.api.hide('everything'), 
                fabric.api.show ('running', 'user', 'output')):

but you can configure it globally.

Hope it helps

Regards


2016-01-28 10:45 GMT+01:00 Elvinas Piliponis <address@hidden>:
Hello,

I am using Fabric to write our internal product deployment utility and having trouble supressing paramiko SSH output, when using DEBUG level. Is it possible to cut off messages like in the example below?

If I set global logging level to INFO, these messages are not printed, however it also hides debug level messages from the installer, which I want to print out.

I have tried to setup different levels of logging output.
    if debug:
        logging.getLogger('paramiko').setLevel(LEVELS.get('info', logging.NOTSET))
        logging.getLogger('requests').setLevel(LEVELS.get('info', logging.NOTSET))

It seems to be set up properly, according to logging_tree (https://pypi.python.org/pypi/logging_tree) output:
   Level DEBUG
   Handler File '/home/xstack/git/installxstream/xsdeploy.log'
     Formatter <logging.Formatter instance at 0x1d17ef0>
   Handler Stream <open file '<stdout>', mode 'w' at 0x7f5e520a9150>
     Level DEBUG
   |
   o<--"paramiko"
   |   Level INFO
   |
   o<--"requests"
       Level INFO
       Handler <requests.NullHandler instance at 0x1b3e2d8>
       |
       o<--[requests.packages]
           |
           o<--"requests.packages.urllib3"
               Level NOTSET so inherits level INFO
               Handler <requests.packages.urllib3.NullHandler instance at 0x1b3e248>
               |
               o<--"requests.packages.urllib3.connectionpool"
               |   Level NOTSET so inherits level INFO
               |
               o<--"requests.packages.urllib3.poolmanager"
               |   Level NOTSET so inherits level INFO
               |
               o<--[requests.packages.urllib3.util]
                   |
                   o<--"requests.packages.urllib3.util.retry"
                       Level NOTSET so inherits level INFO
However at DEBUG level I still get tons of SSH connection noise, which is of no interest for out usage case. I am not intending to debug SSH connection, when enabling debug level for software product installer.

starting thread (client mode): 0x1ef5050L
Connected (version 2.0, client OpenSSH_5.3)
kex algos:['diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'arcfour256', 'arcfour128', 'aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'aes192-cbc', 'aes256-cbc', 'arcfour', 'address@hidden'] server encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'arcfour256', 'arcfour128', 'aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'aes192-cbc', 'aes256-cbc', 'arcfour', 'address@hidden'] client mac:['hmac-md5', 'hmac-sha1', 'address@hidden', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-ripemd160', 'address@hidden', 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', 'address@hidden', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-ripemd160', 'address@hidden', 'hmac-sha1-96', 'hmac-md5-96'] client compress:['none', 'address@hidden'] server compress:['none', 'address@hidden'] client lang:[''] server lang:[''] kex follows?False
Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
Thank you

--

Pagarbiai | Respectfully,

Elvinas Piliponis
Vyresnysis IT inžinierius  | Senior IT Engineer

Virtustream
Kaunas | Lithuania
Mobile: +37069807947 Skype: piktazbacila

address@hidden  |  www.virtustream.com

Keep up with Virtustream:

blog

twitter

linkedin

slideshare

youtube

The information contained in this electronic mail transmission may be privileged and confidential, and therefore, protected from disclosure. If you have received this communication in error, please notify us immediately by replying to this message and deleting the email and its attachments from all computers without copying or disclosing it.


_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user




-- 

--

Pagarbiai | Respectfully,

Elvinas Piliponis
Vyresnysis IT inžinierius  | Senior IT Engineer

Virtustream
Kaunas | Lithuania
Mobile: +37069807947 Skype: piktazbacila

address@hidden  |  www.virtustream.com

Keep up with Virtustream:

blog

twitter

linkedin

slideshare

youtube

The information contained in this electronic mail transmission may be privileged and confidential, and therefore, protected from disclosure. If you have received this communication in error, please notify us immediately by replying to this message and deleting the email and its attachments from all computers without copying or disclosing it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]