codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
265 stars 42 forks source link

Development: Persist structured logs about unexpected errors #248

Closed priitlatt closed 2 years ago

priitlatt commented 2 years ago

At the moment information about failed HTTP requests and stacktraces of unexpected exceptions on failed command line action invocations are only logged into the main logfile. This file also contains a lot of unrelated information, which can be seen as unimportant noise for anyone not directly related to this package. As such it is difficult for package clients to find out the actual root cause of the failure.

In order to make it easier to include relevant information with bug reports, log error and failure information also separately in a JSON serialized standalone files that are easy to share.

Failed HTTP requests are stored in

$TMPDIR/codemagic-cli-tools/failed-http-requests/YYYY-MM-DD/http-<method>-<status>-<url-path>-<timestamp>.json

and unexpected exceptions are saved in

$TMPDIR/codemagic-cli-tools/exceptions/YYYY-MM-DD/error-<error-type>-<timestamp>.json