Class: RabbitmqClient::JsonLogSubscriber
- Inherits:
-
LogSubscriberBase
- Object
- ActiveSupport::LogSubscriber
- LogSubscriberBase
- RabbitmqClient::JsonLogSubscriber
- Defined in:
- lib/rabbitmq_client/json_log_subscriber.rb
Overview
Manage RabbitmqClient plain text logs
Instance Method Summary collapse
- #confirming_message(event) ⇒ Object
- #created_exhange(event) ⇒ Object
- #exhange_not_found(event) ⇒ Object
- #message_confirmed(event) ⇒ Object
- #network_error(event) ⇒ Object
- #overriding_configs(event) ⇒ Object
- #published_message(event) ⇒ Object
- #publisher_created(event) ⇒ Object
- #publishing_message(event) ⇒ Object
Methods inherited from LogSubscriberBase
Instance Method Details
#confirming_message(event) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 43 def (event) debug({ action: 'confirming_message', message: 'Confirming a message' }.merge( process_payload(event.payload) )) end |
#created_exhange(event) ⇒ Object
63 64 65 66 67 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 63 def created_exhange(event) debug(action: 'created_exhange', message: 'Exhange is created successfuly', exchange_name: event.payload.fetch(:name)) end |
#exhange_not_found(event) ⇒ Object
57 58 59 60 61 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 57 def exhange_not_found(event) error(action: 'exhange_not_found', message: 'Exhange Not Found', exchange_name: event.payload.fetch(:name)) end |
#message_confirmed(event) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 50 def (event) debug({ action: 'message_confirmed', message: 'Confirmed a message' }.merge( process_payload(event.payload) )) end |
#network_error(event) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 14 def network_error(event) payload = event.payload error({ action: 'network_error', message: 'Failed to publish a message', error_message: payload.fetch(:error). }.merge( process_payload(payload) )) end |
#overriding_configs(event) ⇒ Object
23 24 25 26 27 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 23 def overriding_configs(event) debug(action: 'overriding_configs', message: 'Overriding publisher configs', publisher_configs: event.payload) end |
#published_message(event) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 36 def (event) info({ action: 'published_message', message: 'Published a message' }.merge( process_payload(event.payload) )) end |
#publisher_created(event) ⇒ Object
8 9 10 11 12 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 8 def publisher_created(event) debug(action: 'publisher_created', message: 'The RabbitmqClient publisher is created', publisher_configs: event.payload) end |
#publishing_message(event) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/rabbitmq_client/json_log_subscriber.rb', line 29 def (event) debug({ action: 'publishing_message', message: 'Publishing a new message' }.merge( process_payload(event.payload) )) end |