fetcher: Log failures into journal

Particularly when HTTP requests fail, I really want a lot more information.
We could theoretically stuff it into the `GError` message field, but
that gets ugly *fast*.

Using the systemd journal allows us to log things in a structured fashion.
Right now e.g. rpm-ostree won't be aware of this additional information,
but I think we could teach it to be down the line.

In the short term, users can learn to find it from `systemctl status rpm-ostreed`
or `journalctl -b -r -u rpm-ostreed`, etc.

One thing I'd like to do next is log successful fetches of e.g. commit objects
as well with more information about the originating server (things like the
final URL if we were redirected, did we use TLS pinning, what was the negotiated
TLS version+cipher, etc).

Closes: #708
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-02-24 22:30:24 +00:00
1 parent cee57a0268
commit 2c326d705e
6 files changed
+64 -6

No files matched your search

+6
View File
@@ -44,6 +44,12 @@ gboolean _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher,
guint64 max_size,
GCancellable *cancellable,
GError **error);
void _ostree_fetcher_journal_failure (const char *remote_name,
const char *url,
const char *msg);
G_END_DECLS
#endif