No handlers could be found for logger paramiko

前端 未结 2 1696
情书的邮戳
情书的邮戳 2020-12-05 19:44

I am using paramiko module for ssh connection.I am facing below problem:

No handlers could be found for logger I am not getting the reason of this problem.I tried to

相关标签:
2条回答
  • 2020-12-05 19:47

    I found the solution from this website.

    Basically, you just need to add a line:

    paramiko.util.log_to_file("filename.log")
    

    Then all connection will be logged to the file.

    0 讨论(0)
  • 2020-12-05 19:55

    cf http://docs.python.org/2.7/howto/logging.html#what-happens-if-no-configuration-is-provided

    To make a long story short: Paramiko uses the logging package and do it the RightWay - which for a library package or module is to not assume anything about the execution context and let the application take care of logging configuration. You have not configured any logger so you get this message. The obvious solution is configure the logging according to your needs.

    0 讨论(0)
提交回复
热议问题