# Error logging

**URL:** <https://forum.ansible.com/t/error-logging/11383>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [March 30, 2012, 12:36pm UTC](https://forum.ansible.com/t/error-logging/11383 "2012-03-30T12:36:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_Hoekx](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jeroen\_Hoekx](https://forum.ansible.com/u/Jeroen_Hoekx)\
**Post date:** [March 30, 2012, 12:36pm UTC](https://forum.ansible.com/t/error-logging/11383/1 "2012-03-30T12:36:38Z")

</div>

Hi,

I think we need a way to get the error output of the module execution  
on the remote system. It has bitten me twice already (no json on RHEL  
5 by default and no "except .. as" support) and debugging it is  
painful if you don't know where to look.

As far as I can see, there are several options:  
- log remote stderr to stderr by default  
- log remote stderr to stderr when a -D --debug flag is given  
- log remote stderr to logfile by default  
- log remote stderr to logfile if given in playbook  
(any combination goes)

Currently, nothing is done with stderr. I prefer 2 and 4. Might try to  
implement it when I find time.

Any opinions on this?

Greetings,

Jeroen

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 30, 2012, 1:35pm UTC](https://forum.ansible.com/t/error-logging/11383/2 "2012-03-30T13:35:26Z")

</div>

Yeah, I like 2 also… but it needs to be done with a Runner callback like on\_stderr so we can do it differently between Runner and Playbook.

(This means the verbosity flag would need to be fed to the callbacks constructor)

This should be quite fine to do, stdout is JSON, std err could be anything.

Make it so!

–Michael
