Ruby
InsightOps supports Logging from Ruby and Ruby on Rails applications
basic
Setup
Log in to InsightOps and create a new log by clicking the Add New Log button. Now click the "Quick add" button. Give your log a name of your choice, select Token TCP and finally click the Create new log button. A token will be displayed in green. Please record it as we will use it later to configure the library.
Install the Library
To install the gem, edit your application Gemfile and add the following line:
1sudo gem install r7insight
Create a logging object in your code
1require 'r7_insight'2logger = R7Insight.new('Your log token here', 'Your region here')
Where your region is eu or us, depending on where your InsightOps account is based
Now add your logging code:
1logger.info("info message")2logger.warn("warning message")3logger.debug("debug message")
Did this page help you?