Conversation
The one thing I think will be hard is to redirect logging from other libraries (Celery, SQLAlchemy) through structlog. We can probably just live with that -- their logs won't be in JSON, but they'll still show up in papertrail or mozdef or whatever. |
Good performance hints at https://structlog.readthedocs.org/en/stable/performance.html |
OK, I think this is ready for review. @amyrrich? |
Also, @Callek what is coveralls' problem.. coverage increased, yet it marks it as failed? Buildbot's looking to switch to http://codecov.io/ since coveralls is basically unusable.. |
That's because we still have coveralls listed to fail for anything less than 98% coverage (you never bumped that with the merge), I'm marking it as passes-at-89% now... As far as codecov.io I'm happy to expiriment with that here, but I don't want to decide to drop coveralls until I've played with it a bit |
@jbryner I'd like to send this to mozdef. Does it look OK? Sample output is
|
I'm going to refactor this a bit to make it look like mozdef wants it to look (with most of the interesting stuff in "details"). |
0927d91
to
6892b12
Compare
Current coverage is
|
@jeffbryner this now looks like
(note: "summary" rather than "message" as you suggested in your email) Does that seem about right? I'll fix up the code coverage in a second. [edit: formatted JSON] |
5b61343
to
c4774bf
Compare
(coverage is fixed) |
(and as usual, the coveralls result is completely bogus) |
looks good to me |
In both flask and celery contexts. This allows per-request and per-task logging data.
Rebased and logging for bug 1137793 added. I'd like one more review of the final form here before I land this. @lundjordan do you mind? |
assuming travis is happy with archiver and the expiry tests this time, wfm. more structure! |
Structured logging seems the way of the future, and
structlog
provides a nice, simple way to use it with Python'slogging
.This could be useful for general logging in relengapi, but would be particularly useful for logging from celery tasks -- the structure can contain the task id, and processors can then correlate that to a badpenny task or whatever other identifier is required (so a fix for #129)