title: How to set custom output handlers for argparse in Python?
body: <p>I have configured <code>logger</code> to print both onto terminal <code>stdout</code> and to a file so I can have an archive of logging messages that I can refer to.</p>
  
  <p>That is easily accomplished by adding a <code>FileHandler</code> to your <code>logging</code> object. Easy peasy.</p>
  
  <p>What I want to accomplish now is to make <code>argparse</code> log also to the same file along with logs to stdout when it encounters parsing errors. So far it only prints to <code>stdout</code>. I looked in the <code>argparse</code> <a href="https://docs.python.org/2.7/library/argparse.html" rel="noreferrer">documentation</a> but I can't find anything about setting a different output stream or pipe for <code>argparse</code>.</p>
  
  <p>Is it possible to do? How?</p>