Is there any way to display Rails' log files in the browser?

rails logger
debug rails
rails logging best practices
rails logger vs puts
rails logger model
rails log formatter
rails logger flush
rails logger test

This might be (read: probably is) a dumb question, but here goes...

Is there a simple, preferably non third-party, way to display Rails logs in the browser? It gets kind of old opening a log file, then closing it and re-opening it on the next error. It would be superfantastic to just to go domain.tld/logs, which would require user authentication, of course.

All you need is to open log file and put its content into browser.

Realted topic: ruby: all ways to read from file.

Also you should know that your logs grow very fast, and it's not a good idea to show whole log in browser. You can just open last 100-200 rows. Related topic: Reading the last n lines of a file in Ruby?

Also you can try this solution: It is more complex and little oftopic, but quite useful.

Getting Started with Rails — Ruby on Rails Guides, Convention Over Configuration: Rails has opinions about the best way to do many A view's purpose is to display this information in a human readable format. Hello I want to use the icon? or is it the alternative span tag? (No idea what its actually called) Anyways, I want to display a icon in my menu here is my current source code.

For reference, there is a very simple way to do this. However, you would want to protect this page with some sort of authentication/authorization.


lines = params[:lines]
if Rails.env == "production"
  @logs = `tail -n #{lines} log/production.log`
  @logs = `tail -n #{lines} log/development.log`

Log File View:

<pre><%= @logs %></pre>

View to display link:

<%= link_to "log file", log_path(lines: 100) %>


get 'logs/:lines' => "pages#log", as: "log"

Rails Routing from the Outside In — Ruby on Rails Guides, How to construct your own routes, using either the preferred resourceful style or the any previous route in the file), then the result will be to invoke the display� By default, Rails creates routes for the seven default actions (index, show, new, create, edit, update, and destroy) for every RESTful route in your application. You can use the :only and :except options to fine-tune this behavior. The :only option tells Rails to create only the specified routes:

I created a for this purpose called browserlog.

Installing is just a matter of adding the gem to the Gemfile:

gem 'browserlog'

Afterwards all you need is to mount the engine on the route you want:

MyApp::Application.routes.draw do
  mount Browserlog::Engine => '/logs'

Once that's set up, accessing /logs/development (or production, test, etc) will show a window like this:


Ruby on Rails - Views, Ruby on Rails - Views - A Rails View is an ERb program that shares data with a corresponding erb file, with the same name as the method, to display the data The next chapter explains how to use Layouts to put your data in a better way. Is there a way to display Rails log files in the browser&quest; This might be (read: probably is) a dumb question, but here goes Is there a simple, preferably non third-party, way to display Rails logs in the browser?

Pimp my Log can be used to visualization many types of logs including Ruby on Rails.

It also includes the management of users and notification.


By default, the PimpMyLog does not support Ruby on Rails logs. It's necessary to implement the regex to works with it.


Leader in Art and Picture Hanging Systems, Looking for quality hanging tracks or rails? Browse our vast The most functional and flexible way to display art in a space: the wall hanging system. With any of� The system uses rails, cables, and hooks to hang your artwork. The rail attaches flush against the wall or ceiling and comes in a white or aluminum color to match your interior décor. Once the rail is in place, attach the cord to the rail so and slide it to the place where you want your picture hung.

Routing, Should we display the “new user” webpage? Should Luckily, typing $ rails routes into the command line will give you an output of all the routes that are available to your application. How do you specify an ID or other variable in a route? I recently broke my Joycon rail pins by using the Paperclip RCM method and I wanna know if there is anyway I can repair it myself instead of buying a new spare part. Also, here are my pin's conditions. I'm seeing a technician tomorrow to see if he can repair it.

Display Rails from School Specialty, Best-Rite Map Display Rail, 1 in H X 8 ft L, Aluminum Frame, Tan Display rails offer a simple solution for posting bulletins and storing important information. Tack-Bite paper holders are an innovative and safe way to display documents,� It's a very common question for those starting out in the hobby. Fortunately, thanks to common standards used by most manufacturers the answer is usually, yes you can. But there are some proprietary patents out there that will limit compatibility.

Map Rails & Hangers Board Accessories You'll Love in 2020, Shop Wayfair for all the best Map Rails & Hangers Board Accessories. Enjoy Free Map Rails & Hangers Grip-A-Strip Display Rail, 12 X 1 1/2. by Advantus� Because of the way that WSL works, only changes made here by Windows applications will be immediately viewable by any Linux applications you are running. If you make changes to C:\Users\<yourUSERNAME>\AppData\Local\lxss\* using anything else but a WSL terminal you will be susceptible to data loss and syncing issues.

  • It's so simple when someone else gives you the solution :) Thank you, sir!
  • "All you need is to open log file and put its content into browser." Sorry. Didn't get what you meant?
  • Wouldn't it be a bit more robust to do log/#{Rails.env}.log instead of if-else?
  • @alexanderbird absolutely, today, I would