Skip to content

Commit

Permalink
service-repl: elaborate mulog-events page with code overview
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Sep 21, 2023
1 parent e91f946 commit 12a57a7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/service-repl-workflow/mulog-events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Mulog

Mulog is an fast and flexible event log library with a wide range of log publisher (Cloudwatch, ..., etc.)
[:fontawesome-brands-github: Mulog](https://github.com/BrunoBonacci/mulog) is an fast and flexible event log library that defines log events as data, with a wide range of log publisher for [:globe_with_meridians: popular aggregation services](https://github.com/BrunoBonacci/mulog#publishers), e.g. Elastic Search, Cloudwatch, Kinesis, Prometheus, etc.)

Using a custom publisher, all mulog events are sent to portal data inspector.

## REPL workflow

Set the global context to define key/value pairs included in every mulog event, e.g. `:service-name` and `:version`.

Define a TapPublisher for mulog which will `tap>` every mulog event created, sending that mulog event to Portal.

`tap-publisher` is a var that starts the custom mulog publisher, providing a reference to the publisher so it can be shut down.

`stop` function is provided as a convienient way to stop the publisher via the REPL.

!!! EXAMPLE "Mulog events publisher"
```clojure title="dev/mulog_events.clj"
Expand All @@ -20,7 +32,7 @@ Mulog is an fast and flexible event log library with a wide range of log publish
;; ---------------------------------------------------------
;; Set event global context
;; - information added to every event for REPL workflow
(mulog/set-global-context! {:app-name "todo-tracker Service",
(mulog/set-global-context! {:service-name "todo-tracker Service",
:version "0.1.0", :env "dev"})
;; ---------------------------------------------------------

Expand Down

0 comments on commit 12a57a7

Please sign in to comment.