Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55194

Add logLevel to support debugging and also reduce default excessive logging

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • ssh-steps-plugin
    • None
    • Jenkins ver. 2.138.3
      SSH Pipeline Steps 1.1.1

      Hello.

      Is it possible to add something like silent or quiet option for sshCommand/sshScript/sshPut/sshGet?

      For example if I have sshCommand hostname I get this in log:

      Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
      [jsch] Permanently added 'server-name' (RSA) to the list of known hosts.
      Connected to server-name[server-name:22] (SSH-2.0-OpenSSH_5.3)
      Started command server-name#41: sudo -S -p '06a1c9b9-933d-4777-8a15-2eb1ceebdf91' /bin/bash -c 'hostname'
      Providing password for sudo prompt on server-name[server-name:22]
      server-name|06a1c9b9-933d-4777-8a15-2eb1ceebdf91
      server-name|server-name
      Success command server-name#41: sudo -S -p '06a1c9b9-933d-4777-8a15-2eb1ceebdf91' /bin/bash -c 'hostname'
      Disconnected from server-name[server-name:22]
      

      So instead of just getting:  
      server-name

      we have all those usually unnecessary lines.
      Having hostname| then log output is also not readable.

      Thanks,

      Vlad

          [JENKINS-55194] Add logLevel to support debugging and also reduce default excessive logging

          Vlad Uros created issue -

          vladaurosh Sure, let me make it as a param, so that we can alter it based on the use case. Thank you for reporting. 

           

          https://github.com/jenkinsci/ssh-steps-plugin/blob/master/src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy#L86

          Naresh Rayapati added a comment - vladaurosh Sure, let me make it as a param, so that we can alter it based on the use case. Thank you for reporting.    https://github.com/jenkinsci/ssh-steps-plugin/blob/master/src/main/groovy/org/jenkinsci/plugins/sshsteps/SSHService.groovy#L86

          Vlad Uros added a comment -

          Thanks Naresh.

          If possible, please add as well option to hide server name before command output, for example:
          server-name|command_output

          Vlad Uros added a comment - Thanks Naresh. If possible, please add as well option to hide server name before command output, for example: server-name|command_output

          Naresh Rayapati added a comment - PR: https://github.com/jenkinsci/ssh-steps-plugin/pull/12
          Naresh Rayapati made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Naresh Rayapati made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Naresh Rayapati made changes -
          Summary Original: Excessive logging New: Add logLevel to support debugging and also reduce default excessive logging
          Naresh Rayapati made changes -
          Description Original: Hello.

          Is it possible to add something like silent or quiet option for sshCommand/sshScript/sshPut/sshGet?

          For example if I have sshCommand hostname I get this in log:

          Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
          [jsch] Permanently added 'server-name' (RSA) to the list of known hosts.
          Connected to server-name[server-name:22] (SSH-2.0-OpenSSH_5.3)
          Started command server-name#41: sudo -S -p '06a1c9b9-933d-4777-8a15-2eb1ceebdf91' /bin/bash -c 'hostname'
          Providing password for sudo prompt on server-name[server-name:22]
          server-name|06a1c9b9-933d-4777-8a15-2eb1ceebdf91
          server-name|server-name
          Success command server-name#41: sudo -S -p '06a1c9b9-933d-4777-8a15-2eb1ceebdf91' /bin/bash -c 'hostname'
          Disconnected from server-name[server-name:22]

          So instead of just getting:  
          server-name

          we have all those usually unnecessary lines.
          Having hostname| then log output is also not readable.

          Thanks,

          Vlad
          New: Hello.

          Is it possible to add something like silent or quiet option for sshCommand/sshScript/sshPut/sshGet?

          For example if I have sshCommand hostname I get this in log:

          {code}
          Host key checking is off. It may be vulnerable to man-in-the-middle attacks.
          [jsch] Permanently added 'server-name' (RSA) to the list of known hosts.
          Connected to server-name[server-name:22] (SSH-2.0-OpenSSH_5.3)
          Started command server-name#41: sudo -S -p '06a1c9b9-933d-4777-8a15-2eb1ceebdf91' /bin/bash -c 'hostname'
          Providing password for sudo prompt on server-name[server-name:22]
          server-name|06a1c9b9-933d-4777-8a15-2eb1ceebdf91
          server-name|server-name
          Success command server-name#41: sudo -S -p '06a1c9b9-933d-4777-8a15-2eb1ceebdf91' /bin/bash -c 'hostname'
          Disconnected from server-name[server-name:22]
          {code}

          So instead of just getting:  
          server-name

          we have all those usually unnecessary lines.
          Having hostname| then log output is also not readable.

          Thanks,

          Vlad
          Naresh Rayapati made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

          Merged will release it after further testing.

          Naresh Rayapati added a comment - Merged will release it after further testing.

            nrayapati Naresh Rayapati
            vladaurosh Vlad Uros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: