Skip to content

Commit

Permalink
Add verbosity_map and integer timestamp example
Browse files Browse the repository at this point in the history
since rabbitmq/rabbitmq-server#3281 and
rabbitmq/rabbitmq-server#3283 are merged.

Example log output:
{"v":7,"time":1629703633887530,"msg":"accepting AMQP connection <0.1321.0> (10.244.0.1:43532 -> 10.244.0.14:5672)","domain":"rabbitmq.connection","pid":"<0.1321.0>","gl":"<0.223.0>"}
  • Loading branch information
ansd committed Aug 23, 2021
1 parent 01ac388 commit 43d77af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/examples/json-log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pull Requests:
* [Switch from Lager to the new Erlang Logger API for logging #2861](https://github.com/rabbitmq/rabbitmq-server/pull/2861)
* [Logging: Add configuration variables to set various formats #2927](https://github.com/rabbitmq/rabbitmq-server/pull/2927)

This example configures RabbitMQ to output JSON logs.
This example (requiring RabbitMQ >= v3.9.3) configures RabbitMQ to output JSON logs.

You can deploy this example like this:

Expand Down
5 changes: 3 additions & 2 deletions docs/examples/json-log/rabbitmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ spec:
log.console = true
log.console.level = debug
log.console.formatter = json
log.console.formatter.json.field_map = level time msg domain file line pid
log.console.formatter.time_format = rfc3339_T
log.console.formatter.json.field_map = verbosity:v time msg domain file line pid level:-
log.console.formatter.json.verbosity_map = debug:7 info:6 notice:5 warning:4 error:3 critical:2 alert:1 emergency:0
log.console.formatter.time_format = epoch_usecs

0 comments on commit 43d77af

Please sign in to comment.