{"id":20445876,"url":"https://github.com/rapid7/r7insight_ruby","last_synced_at":"2025-04-13T00:44:24.325Z","repository":{"id":56889997,"uuid":"92946522","full_name":"rapid7/r7insight_ruby","owner":"rapid7","description":"Ruby logging support for InsightOps","archived":false,"fork":false,"pushed_at":"2024-02-29T11:39:03.000Z","size":43,"stargazers_count":4,"open_issues_count":2,"forks_count":12,"subscribers_count":47,"default_branch":"master","last_synced_at":"2024-12-18T06:23:47.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapid7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-31T13:09:07.000Z","updated_at":"2024-12-12T22:36:36.000Z","dependencies_parsed_at":"2024-11-15T10:25:37.716Z","dependency_job_id":null,"html_url":"https://github.com/rapid7/r7insight_ruby","commit_stats":{"total_commits":18,"total_committers":10,"mean_commits":1.8,"dds":0.7777777777777778,"last_synced_commit":"190c121255b691b8a7c1140d500a3f29f20f07b1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fr7insight_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fr7insight_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fr7insight_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fr7insight_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapid7","download_url":"https://codeload.github.com/rapid7/r7insight_ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650419,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:15:10.749Z","updated_at":"2025-04-13T00:44:24.303Z","avatar_url":"https://github.com/rapid7.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Logging to Rapid7 Insight Platform in Ruby\n==========================================\n\n[![Build Status](https://travis-ci.org/rapid7/r7insight_ruby.svg?branch=master)](https://travis-ci.org/rapid7/r7insight_ruby)\nThis is a library for logging from Ruby platforms to the Rapid7 Insight Platform, including Heroku.\n\nIt is available on github \u003chttps://github.com/rapid7/r7insight_ruby/\u003e and rubygems\n\u003chttp://rubygems.org/\u003e.\n\n\nExample\n-------\n\n    Rails.logger.info(\"information message\")\n    Rails.logger.warn(\"warning message\")\n    Rails.logger.debug(\"debug message\")\n\nHowto\n-----\n\nYou must first register your account on the Rapid7 Insight Platform.\n\nOnce you have logged into the platform, create a new host with a name of your choice.\nInside this host, create a new logfile, selecting `Token TCP` (or `Plain TCP/UDP` if using UDP)\nas the source type.\n\nHeroku\n------\n\nTo install the gem you must edit the Gemfile in your local heroku environment\n\nAdd the following line:\n\n    gem 'r7insight'\n\nThen from the cmd line run the following command:\n\n    bundle install\n\nThis will install the gem on your local environment.\n\nThe next step is to configure the default rails logger to use the Rapid7 Insight Platform logger.  \nEnsure you add a `require` to load in the package:\n\n    require 'r7_insight.rb'\n\nIn your environment configuration file ( for production : `config/environments/production.rb`), add the following:\n\n    Rails.logger = R7Insight.new('LOG_TOKEN', 'REGION')\n\nIf you want to keep logging locally in addition to sending logs to in, just add local parameter after the key.\nBy default, this will write to the standard Rails log or to STDOUT if not using Rails:\n\n    Rails.logger = R7Insight.new('LOG_TOKEN', 'REGION', :local =\u003e true)\n\nYou may specify the local log device by providing a filename (String) or IO object (typically STDOUT, STDERR, or an open file):\n\n    Rails.logger = R7Insight.new('LOG_TOKEN', 'REGION', :local =\u003e 'log/my_custom_log.log')\n\nIf you want the gem to use SSL when streaming logs to the Rapid7 Insight Platform, add the ssl parameter and set it to true:\n\n    Rails.logger = R7Insight.new('LOG_TOKEN', 'REGION', :ssl =\u003e true)\n\nIf you want to print debug messages for the gem to a file called r7insightGem.log, add this:\n\n\tRails.logger = R7Insight.new('LOG_TOKEN', 'REGION', :debug =\u003e true)\n\nIf you want to use ActiveSupport::TaggedLogging logging, add this:\n\n    Rails.logger = R7Insight.new('LOG_TOKEN', 'REGION', :tag =\u003e true)\n\nYou can also specify the default level of the logger by adding a :\n\n    Rails.logger = R7Insight.new('LOG_TOKEN', 'REGION', :log_level =\u003e Logger::\u003clevel\u003e)\n\nFor the `LOG_TOKEN` argument, paste the token for the logfile you created earlier in the Rapid7 Insight UI or empty string for\na UDP connection.\n\nFor the `REGION` argument, provide the region of your account, e.g: 'eu', 'us' etc.\n\nAdditionally, when connecting via UDP, be sure to specify a port using the udp_port parameter:\n\n    Rails.logger = R7Insight.new('', 'REGION' :udp_port =\u003e 13287)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fr7insight_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapid7%2Fr7insight_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fr7insight_ruby/lists"}