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:

1
sudo gem install r7insight

Create a logging object in your code

1
require 'r7_insight'
2
logger = 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:

1
logger.info("info message")
2
logger.warn("warning message")
3
logger.debug("debug message")