{"id":20445828,"url":"https://github.com/rapid7/le_ruby","last_synced_at":"2025-12-18T04:36:52.766Z","repository":{"id":56880916,"uuid":"2088715","full_name":"rapid7/le_ruby","owner":"rapid7","description":"Ruby logging support for logentries.com","archived":false,"fork":false,"pushed_at":"2024-11-06T08:53:15.000Z","size":137,"stargazers_count":47,"open_issues_count":13,"forks_count":48,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-03-02T18:17:06.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://logentries.com/","language":"Ruby","has_issues":false,"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":null,"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":"2011-07-22T13:21:26.000Z","updated_at":"2024-11-06T08:53:19.000Z","dependencies_parsed_at":"2024-12-02T07:34:15.312Z","dependency_job_id":null,"html_url":"https://github.com/rapid7/le_ruby","commit_stats":{"total_commits":167,"total_committers":33,"mean_commits":"5.0606060606060606","dds":0.5748502994011976,"last_synced_commit":"c3d5f69d840d0cdcd40aeb175221d26a17170a73"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fle_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fle_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fle_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fle_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapid7","download_url":"https://codeload.github.com/rapid7/le_ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242951169,"owners_count":20211572,"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:14:31.004Z","updated_at":"2025-12-18T04:36:52.703Z","avatar_url":"https://github.com/rapid7.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\n**Please note that this library is deprecated, and will no longer be updated. Please use [the r7insight library](https://github.com/rapid7/r7insight_ruby) for new applications and consider upgrading your existing applications to it.** The new library is compatible with both Logentries (EU region) and InsightOps.\n\n------\n# About\n\n[![Build Status](https://travis-ci.org/rapid7/le_ruby.svg?branch=master)](https://travis-ci.org/rapid7/le_ruby)\nThis is the legacy Logentries library for logging from Ruby platforms, including Heroku.\n\n------\n\nIt is available on github \u003chttps://github.com/rapid7/le_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\n\nHowto\n-----\n\nYou must first register your account details with Logentries.\n\nOnce you have logged in to Logentries, 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 'le'\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 logentries\nlogger.  \n\n\nIn your environment configuration file ( for production : `config/environments/production.rb`), add the following:\n\n    Rails.logger = Le.new('LOGENTRIES_TOKEN')\n\nIf you want to keep logging locally in addition to sending logs to logentries, 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 = Le.new('LOGENTRIES_TOKEN', :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 = Le.new('LOGENTRIES_TOKEN', :local =\u003e 'log/my_custom_log.log')\n\nIf you want the gem to use SSL when streaming logs to Logentries, add the ssl parameter and set it to true:\n\n    Rails.logger = Le.new('LOGENTRIES_TOKEN', :ssl =\u003e true)\n\nIf you want to print debug messages for the gem to a file called logentriesGem.log, add this:\n\n\tRails.logger = Le.new('LOGENTRIES_TOKEN', :debug =\u003e true)\n\nIf you want to use ActiveSupport::TaggedLogging logging, add this:\n\n    Rails.logger = Le.new('LOGENTRIES_TOKEN', :tag =\u003e true)\n\nYou can also specify the default level of the logger by adding a :\n\n    Rails.logger = Le.new('LOGENTRIES_TOKEN', :log_level =\u003e Logger::\u003clevel\u003e)\n\nFor the `LOGENTRIES_TOKEN` argument, paste the token for the logfile you created earlier in the Logentries UI or empty string for\na UDP connection. Additionally, when connecting via UDP, be sure to specify a port using the udp_port parameter:\n\n    Rails.logger = Le.new('', :udp_port =\u003e 13287)\n\nUsers have the option of using `data.logentries.com` which uses ports 80 and 443 for insecure and secure connections respectively.\n    \n    Rails.logger = Le.new('', :data_endpoint =\u003e true)\n\n\n\nStep for setting up DataHub\n---------------------------\n\n**datahub_endpoint - User Defined Array**\n\ndatahub_endpoint = Array [\"127.0.0.1\", \"10000\"]  \ndatahub_endpoint is a user defined variable array for a datahub_endpoint\nThe 1st parameter is a String which is the DataHub Instance's IP Address.  Entering ANY value in this field will disable your Token-based\nlogging, set your Token to \"\" and will direct all log events to your specified DataHub IP Address.\n\nThe 2nd parameter is a String which is the DataHub Port value, default is 10000 but this can be changed on your DataHub Machine.\nThis port number must be set, on your DataHub Machine's leproxy settings your /etc/leproxy/leproxyLocal.config file.  It's default is 10000\nNOTE: if datahub_endpoint has been assigned an IP address and SSL = true, your server will fail gracefully.\nWhen using Datahub do not enable SSL = true  \n\n\n**host_id**\n\nhost_id = \"abc1234\"  \nEnter_host_id inside the quotation marks.  Leaving this empty leave the host_id empty and thus not appear in your log events.\n\n\n**custom_host_name - User Defined Array**\n\ncustom_host = Array[ true, \"mikes_app_server\"]\nThe 1st parameter is a Boolean value to use the custom host name.\nThe 2nd parameter is a String which is the custom_host_name you'd like to assign.  \n\nIf the 2nd parameter is left as in custom_host = Array[ true, \"\"] the code will attempt to get your host machine's name using the socket.gethostname method.\n\n\n\nUsing the above user defined variable settings, you can now also specify the several of the optional arguments for the logger constructor by adding:\n\n    Rails.logger = Le.new(token, :ssl=\u003essl, :datahub_endpoint=\u003edatahub_endpoint, :host_id=\u003ehost_id, :custom_host=\u003ecustom_host)\n\n\nNow, simply use `Rails.logger.info(\"message\")` inside your code to send logs to Logentries\n\n\nContact Support\n------\n\nPlease email our support team at support@logentries.com if you need any help.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fle_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapid7%2Fle_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fle_ruby/lists"}