practicalli / practicalli/clojure-web-services
Logging with mulog and unstructured messaging like jetty
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 16
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
https://clojurians.slack.com/archives/C010TGGL02X/p1627067453014700
Mixing structured and unstructured logs
E.g including jetty logs with mulog
@ bruno.bonacci is it possible to use mulog to capture the logs from an embedded jetty server that runs my web application (reitit, ring). Or would a more typical java logger to capture the jetty logs and push them to the same log service as mulog
Ah, it seems I would just send both sources to something like elastic search and that would merge the two sources.
Hi @practicalli-john, yes μ/log can do that.
with a single well crafted ring wrapper you can callect enough information to perform a large number of queries (see comment)
this was one of the main design goals of μ/log.
here there is a simple wrapper example
This works, not only on a single application, but if you are in a microservice environment, and each system instruments with a fairly simple wrapper you can get tracing across all your application without the need of expensive tooling and you still get to keep the raw data.
μ/trace captures the relationship of internal calls to other μ/trace as well generating call traces like
https://raw.githubusercontent.com/BrunoBonacci/mulog/master/examples/roads-disruptions/doc/images/disruption-trace.png
There are teams that use it to build complex pipelines to detect quite sophisticate issues in their systems
μ/log -> kafka -> streaming-app -> kafka -> monitoring-dashboard
and it is just the same data that they already use with Elasticsearch or Cloudwatch
(at some point) I hope to make a talk about how teams use μ/log for observability and operation (autoscaling, downscaling, warm-up, etc)
seeing all this in practice makes so much more sense.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading examples/roads-disruptions/src/com/brunobonacci/disruptions/api.clj around lines 56-69 and the linked μ/log discussion. The issue does not define a concrete change or acceptance condition, so clarify whether Jetty log capture or a documented integration is wanted before implementation; done would require an agreed scope and demonstrated unified logging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, java
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100