--- id: collect-ruby-on-rails-logs title: Collect Ruby on Rails Logs sidebar_label: Ruby on Rails description: Learn how to collect logs produced by Ruby on Rails applications. slug: /help/docs/send-data/collect-from-other-data-sources/collect-ruby-on-rails-logs/ canonical: https://www.sumologic.com/help/docs/send-data/collect-from-other-data-sources/collect-ruby-on-rails-logs/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; When collecting more complex application logs, like those generated by Ruby on Rails (RoR) applications, you must complete a few essential steps to make sure that your logs are ingested and parsed correctly. ## Set up a Ruby on Rails (RoR) Log Source RoR generates multiline log entries, which require a few extra steps to configure. The essential elements are the log file path, the time zone, and the multiline setup. 1. [Install a Collector](/docs/send-data/installed-collectors) on the machine running your application. 1. Create a [Local File Source](/docs/send-data/installed-collectors/sources/local-file-source). Then, under **File Path**, input the log path specified for `config.log_path`. :::note By default Rails uses `log/#{environment}.log` (e.g. `log/development.log` or `log/production.log`). ::: Ruby on Rails 1. Enable timestamp parsing. If your logs do not contain a time zone as part of the timestamp, you will need to specify the time zone of the messages. Make sure to set the [time zone](/docs/send-data/reference-information/time-reference.md) correctly. Misconfigured time zones can cause problems. For example, in searches, data will appear to be in the future. And in Dashboards, no data will be displayed. 1. Enable [multiline processing](/docs/send-data/reference-information/collect-multiline-logs.md). To do this, under Boundary Regex, enter what the first line of your RoR log looks like. Typically (depending on your configuration and platform) it will begin with with the words "Starting" or "Processing". Check your logs to confirm. Enter the string `^Processing.*` or `^Starting.*`. 1. If you have configured your RoR logs to output something like the date before "Starting" or "Processing", you will need to match that as well. For example, `^\[[0-9/:\s]+\]\s+Processing.*`. 1. Click **Save**.  1. Verify that the logs are being ingested. [**New UI**](/docs/get-started/sumo-logic-ui). In the Sumo Logic main menu select **Data Management**, and then under **Data Collection** select **Status**. You can also click the **Go To...** menu at the top of the screen and select **Status**.
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data > Collection > Status**. 1. If you do not see any data coming in after 2-3 minutes, check that your file path is correct, that the Sumo Logic Collector has read access to the logs, and that your time zone is configured correctly. ## Parsing RoR Logs Once you have ingested the logs, parsing is straightforward. Your logs might look something like this: ``` [29514] [07-10-13 12:54] : Processing SomeComponent#show (for 111.111.111.111 at 2013-07-10 12:54:19) [GET] [29514] [07-10-13 12:54] : Parameters: {"slug"\>"2013/7/7/4502012/someurl", "action"\>"show", controller"\>"somecomponent"} [29514] [07-10-13 12:54] : Rendering template within layouts/somecomponent [29514] [07-10-13 12:54] : Rendering somecomponent/article [29514] [07-10-13 12:54] : Completed in 934ms (View: 850, DB: 75) | 200 OK [http://www.somecompany.com/someurl] [31594] [07-10-13 12:54] : ::: For that format, you could do a search query like this: ```sumo _sourceCategory=*RoR* | parse "Completed in *ms (View: *, DB: *) | * OK" as totalTime,viewTime,dbTime,returnCode | timeslice by 1m | avg(totalTime) as avgTotalTime by _timeslice ``` For the latest information on Ruby on Rails, see http://guides.rubyonrails.org/.