rabbitmq logs in json format.

1,244 views
Skip to first unread message

maha...@gmail.com

unread,
Apr 23, 2018, 3:14:09 PM4/23/18
to rabbitmq-users
Hi:
Is there a way to get rabbitmq log messages in json format ? I am using version 3.7.4

Thanks
Maha

Luke Bakken

unread,
Apr 23, 2018, 4:04:17 PM4/23/18
to rabbitmq-users
Hi Maha,

Log messages in JSON is not supported. Thanks for asking on the mailing list, however, and continue to use this resource if you have further questions.

Luke

maha sfdx

unread,
Apr 25, 2018, 9:16:19 PM4/25/18
to rabbitm...@googlegroups.com
Thanks Luke! I am trying to use advanced.config with lager_json_formatter(https://github.com/botsunit/lager_json_formatter) . Is there a doc or how-to for building the formatters and how to add them to rabbitmq deployment ?

Maha

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luke Bakken

unread,
Apr 26, 2018, 12:53:09 PM4/26/18
to rabbitmq-users
Hi Maha -

This question was asked earlier this year, and here is my reply - https://groups.google.com/d/msg/rabbitmq-users/KmjRYB78ROw/LT5TyAgDBwAJ

Let me know if you need assistance. What operating system are you using?

Thanks -
Luke

On Wednesday, April 25, 2018 at 6:16:19 PM UTC-7, m wrote:
Thanks Luke! I am trying to use advanced.config with lager_json_formatter(https://github.com/botsunit/lager_json_formatter) . Is there a doc or how-to for building the formatters and how to add them to rabbitmq deployment ?

Maha

m

unread,
Apr 26, 2018, 2:20:04 PM4/26/18
to rabbitmq-users
I am working with the publicly available docker images - either alpine or debian. Is it still the same process?


On Thursday, April 26, 2018 at 12:53:09 PM UTC-4, Luke Bakken wrote:
Hi Maha -

This question was asked earlier this year, and here is my reply - https://groups.google.com/d/msg/rabbitmq-users/KmjRYB78ROw/LT5TyAgDBwAJ

Let me know if you need assistance. What operating system are you using?

Thanks -
Luke

On Wednesday, April 25, 2018 at 6:16:19 PM UTC-7, m wrote:
Thanks Luke! I am trying to use advanced.config with lager_json_formatter(https://github.com/botsunit/lager_json_formatter) . Is there a doc or how-to for building the formatters and how to add them to rabbitmq deployment ?

Maha
On Mon, Apr 23, 2018 at 4:04 PM, Luke Bakken wrote:
Hi Maha,

Log messages in JSON is not supported. Thanks for asking on the mailing list, however, and continue to use this resource if you have further questions.

Luke


On Monday, April 23, 2018 at 12:14:09 PM UTC-7, maha.sfdx wrote:
Hi:
Is there a way to get rabbitmq log messages in json format ? I am using version 3.7.4

Thanks
Maha

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

Luke Bakken

unread,
Apr 26, 2018, 2:30:41 PM4/26/18
to rabbitmq-users
Yes, though the configuration file is /etc/rabbitmq/advanced.config

When you install Erlang, it will install a compiler. You should just need to install git or extract the source code to the lager_json_formatter plugin, then run this command:

./rebar3 compile

That will produce a .beam file in _build/default/lib/lager_json_formatter/ebin/

You then copy lager_json_formatter.beam to a directory in the code path for RabbitMQ:

rabbitmqctl eval 'code:get_path().'

This produces a lot of output on my Ubuntu 16 VM, but the first directory is what you want:

/usr/lib/rabbitmq/lib/rabbitmq_server-3.7.5-beta.3/ebin

The directory will be different in your installation, but that's where you copy the beam file.

After configuring lager correctly and re-starting RabbitMQ, you should have logs in JSON format.

Let me know how it goes,
Luke

Nikolay Kalaydzhiev

unread,
Jul 25, 2019, 8:52:29 AM7/25/19
to rabbitmq-users
Hi Luke, this post helped me a lot but now that lagger is under the hood of Rabbitmq is it possible to have the output reformatted in JSON without using the lager_json_formater ? 

Luke Bakken

unread,
Jul 29, 2019, 12:41:19 PM7/29/19
to rabbitmq-users
Hello,

lager_json_formater is required to output JSON.

We can investigate shipping this plugin with RabbitMQ, but I can't promise that it will be included. If you have problems building and installing lager_json_formater please post a new message to this group with information.

Thanks,
Luke

Nikolay Kalaydzhiev

unread,
Aug 1, 2019, 3:31:38 AM8/1/19
to rabbitmq-users

Thanks Luke for the clarification , the thing is that i'm deploying rabbitmq in a kubernetes cluster and i would prefere not to build my own images  with some extra plugins etc. 

Luke Bakken

unread,
Aug 1, 2019, 10:23:25 AM8/1/19
to rabbitmq-users
Hi Nikolay,

Noted. I'll bring this up with the RabbitMQ team this week.

Thanks,
Luke
Message has been deleted

Michael Klishin

unread,
Oct 3, 2019, 5:23:35 AM10/3/19
to rabbitmq-users
We've concluded that we won't be including Lager JSON formatter because we would not want to maintain it,
and once you depend on something, that dependency's problems become your problems eventually.

On Thu, Aug 1, 2019 at 6:31 PM Nikolay Kalaydzhiev <nilu...@gmail.com> wrote:
Thanks a lot Luke for all your effort ! 

--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/utG76rpGvvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/04dfc7a7-428f-45c6-88ed-e1cd07484fb9%40googlegroups.com.


--
Nikolay Kalaydzhiev

78A, Cité Am Wenkel, L-8086 Bertrange
@:       nilu...@gmail.com

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Nikolay Kalaydzhiev

unread,
Oct 3, 2019, 5:56:31 AM10/3/19
to rabbitmq-users
Thanks Michael for the update, do you foresee a built-in method for outputting the logs in json ? 
To unsubscribe from this group and all its topics, send an email to rabbitm...@googlegroups.com.


--
Nikolay Kalaydzhiev

78A, Cité Am Wenkel, L-8086 Bertrange
@:       nilu...@gmail.com

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

Michael Klishin

unread,
Oct 3, 2019, 6:08:46 AM10/3/19
to rabbitmq-users
If we wanted to add such feature using the JSON Lager output would be the easiest option.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d9583716-c061-4e16-a190-03f6c56c804e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages