Skip to content

Commit 8d96556

Browse files
service-repl: elaborate mulog-events page with code overview
1 parent e91f946 commit 8d96556

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

docs/service-repl-workflow/mulog-events.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Mulog
22

3-
Mulog is an fast and flexible event log library with a wide range of log publisher (Cloudwatch, ..., etc.)
3+
[:fontawesome-brands-github: Mulog](https://github.com/BrunoBonacci/mulog) is library that defines log events as data, with a wide range of publisher for [:globe_with_meridians: popular log aggregation services](https://github.com/BrunoBonacci/mulog#publishers), e.g. Elastic Search, Cloudwatch, Kinesis, Prometheus, etc.)
4+
5+
Creating a custom publisher, all mulog events can be sent to portal data inspector.
6+
7+
![Portal - mulog event messages tap>](https://github.com/practicalli/graphic-design/blob/live/portal/portal-mulog-tap-publisher-repl-startup-dark.png?raw=true){loading=lazy}
8+
9+
10+
## Mulog configuration
11+
12+
`mulog/set-global-context!` defines key/value pairs included in every mulog event allowing a separate context to be used for logs, e.g. `:env :dev` indicating development time events.
13+
14+
`TapPublisher` defines a custom Mulog publisher which wraps `tap>` around every mulog event created, sending each mulog event to Portal.
15+
16+
`tap-publisher` is a var that starts the custom mulog publisher, providing a reference to the publisher so it can be shut down.
17+
18+
`stop` function is provided as a convienient way to stop the publisher via the REPL.
419

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

0 commit comments

Comments
 (0)