# How to log bad data in an import script

**URL:** <https://meta.discourse.org/t/how-to-log-bad-data-in-an-import-script/49034>\
**Category:** Development\
**Created:** [2016 年 8 月 22 日午後 11:41 UTC](https://meta.discourse.org/t/how-to-log-bad-data-in-an-import-script/49034 "2016-08-22T23:41:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)\
**Post date:** [2016 年 8 月 23 日午前 12:15 UTC](https://meta.discourse.org/t/how-to-log-bad-data-in-an-import-script/49034/2 "2016-08-23T00:15:32Z")

</div>

Yes, problems and errors should be sent to stderr, rather than stdout. The user can then capture that output to a file for later analysis, with `2>/tmp/import_errors.log`, without interrupting the progress and status information.

---

_[View the full topic](https://meta.discourse.org/t/how-to-log-bad-data-in-an-import-script/49034)._
