title: Slack Notification upload/attach log file
body: <p>I prepared a jenkins pipeline under which if any step fails, Jenkins then send notification on respective slack channel with the link containing Job Console output URL. What I am planning is to get output logs and send them as a attachment to the channel if job fails somewhere in between but not the URL (I don't want anybody to login to jenkins to check logs).</p>
  
  <p>Currently what I am doing is (working fine):</p>
  
  <pre><code>    stage ('1- Pull SourceCode')
      {
          try
          {
              node
              {
                  print "Test SVN Checkout"
                  //checkout command
              }
          }
          catch(Exception e)
          {
              currentBuild.result = 'FAILURE'
              slackSend (channel: '#channelname', color: '#FF0000', message: "Stage 1 Failed : check  error logs at ${env.JOB_URL}" , teamDomain: 'xyz', token: 'token')
          }
      }
  </code></pre>
  
  <p>Could somebody help me with slackSend command which picks the log file from some location and send it as an attachment to the channel.
  Or 
  slackSend command to send pipeline <strong>stage</strong> logs as attachment to slack channel.</p>