title: Send logs to Slack from Python
body: <p>Is it possible to redirect logs from the built in <code>logging</code> module to a Slack channel, rather than stdout or a file.</p>
  
  <p>I was thinking there might be some way to do this using the Slack <a href="https://github.com/slackapi/python-slackclient" rel="nofollow noreferrer">API client</a>:</p>
  
  <pre class="lang-py prettyprint-override"><code>import logging
  from slackclient import SlackClient
  
  slack_token = 'MY-TOKEN-HERE'
  sc = SlackClient(slack_token)
  
  logging.basicConfig(...)  # Some slack magic???
  
  logging.debug('This message should go to a slack channel')
  logging.info('So should this')
  logging.warning('And this, too')
  </code></pre>