See in live what is happening on server in real-time. Track all activities.
MIT License
Watch application activities in real-time using them gem. Live stream for all events which you want to monitor.
Use tags, categories, custom message and even user. Get better picture of what happening on server.
Every event will be prepender in the list with all the details.
Link to video: https://www.youtube.com/watch?v=1PhyEgU7Pao
Just open in browser /rails/live
and watch for updates. BUT to capture them you need to add code something like:
after_create :notify
def notify
RailsLive.notify({
message: "article id: #{self.id} created",
tags: {
category.name => 'info',
},
category: 'article'
})
end
or
before_action :log_action
def log_action
RailsLive.notify({
message: "action on server #{request.url}",
tags: {
action_name => 'light',
},
user: {
id: current_user&.id,
full_name: current_user&.full_name
},
category: controller_name
})
end
or anywhere from code
RailsLive.notify({
message: "action on server #{request.url}",
tags: {
'admin' => 'danger',
'approved' => 'success',
},
user: {
id: user.id,
full_name: user&.full_name
},
category: 'category'
})
Note: it doesn't store all events in DB. It just broadcasting them to dashboard.
gem 'rails_live'
And then execute:
$ bundle
If you want to customize gem (create initializer) run in console:
rails g rails_live initializer
If will create file config/initializers/rails_live.rb.
If you want to add routes manually (or customize the mounted location) you need to first turn off automatic_routes_mount
and then add to your routes.rb
mount RailsLive::Engine => '/rails/live', :as => 'rails_live'
You are welcome to contribute to this gem.
The gem is available as open source under the terms of the MIT License.