zalando / friboo

Utility library for writing microservices in Clojure, with support for Swagger and OAuth
Apache License 2.0
118 stars 16 forks source link

More flexible audit logging #79

Closed prayerslayer closed 7 years ago

prayerslayer commented 7 years ago

Hi there!

I'm not completely happy with the audit logging in friboo. The way it currently works is storing all successful (2xx) responses to PUT/POST/PATCH/DELETE requests, which is very unflexible and low-level.

Sometimes your audit logs involve data that's not in a HTTP body, you may want to ship it somewhere else than S3 (file, database, REST API...) and so forth.

I don't have a good idea yet how to do this in a good and simple way. Maybe one could (mis?)use timbre to have already an ecosystem for appenders available and/or easily plug custom ones?

prayerslayer commented 7 years ago

Okay, played around with timbre° a little. What about this:

What do you think? Overkill? Not needed?

There are also some follow-up questions to clarify, e.g. how this relates to friboo.log and slf4j.

° If you have another suggestion, please go ahead. I just find the existing concepts of appenders etc quite flexible and reusable.

prayerslayer commented 7 years ago

Clarify: How SLF4J Markers play in here http://www.slf4j.org/api/org/slf4j/Marker.html

Apparently Markers are not supported in tools.logging or timbre, so it's not as easy to use them.