measure to manage
class Loggerit < ActiveResource::Base headers["X-LoggerItKey"] = "YOUR_API_KEY_GOES_HERE" self.site = "http://loggerit.com" end
# call from anywhere in your application - models, controllers, views, libs ... Loggerit.create(:event_name => "New Account", :attrs => {:user => current_user.username}) Loggerit.create(:event_name => "Visit Subscription Page", :attrs => {:user_id => current_user.id}) Loggerit.create(:event_name => "Background Job #1", :attrs => {:user_id => current_user.id, :duration => end_time - start_time, :processed_file => file.path}) Loggerit.create(:event_name => "Purchase", :attrs => {:user => "Charlie", :amount => "$30.00"}) Loggerit.create(:event_name => "Purchase", :attrs => {:amount => "$30.00", :ip_address => request.remote_ip, :item_id => purchase.item.id}) # :event_name (required) # set to a string representation of your event # used to help you organize what is being collected # :attrs (optional) # set to a hash of key/value pairs you would like Logger It to track # the attribute keys for a given :event_name are not required to be the same # for an example - see the last two code samples above
curl -i -X POST \ -H "Content-Type: application/xml" \ -H "X-LoggerItKey: YOUR_API_KEY_GOES_HERE" \ -d "<loggerit> <event_name>Test Event</event_name> <attrs> <key1>val8</key1> <key2>val2</key2> </attrs> </loggerit>" \ http://loggerit.com/loggerits.xml