better exitcode treament and json log