dieb / browserlog Goto Github PK
View Code? Open in Web Editor NEWDevelopment halted. Watch rails logs live in your browser.
License: MIT License
Development halted. Watch rails logs live in your browser.
License: MIT License
I want to propose a feature which I think will be quite useful for apps running in production environment either on staging or live servers. The feature should allow admin / users (who have access to see browserlog) to view filtered logs for some particular request e.g. /controller/problem_method
. This feature will help users to track issues about some particular request in a clean way.
Let me know you what you think about this?
See also: OSX.gitignore
Loving this gem - useful! I want to use this to keep track of emails that are sent through my app and have been tinkering in the development environment. In-browser, email headers and other parameters are left out in dev. Works fine in production! Using MailForm https://github.com/plataformatec/mail_form.
FYI - Using Rails 4.1.8, docs say compatibility for up to 4.1.1. :)
Started GET "/logs/development/changes.json?currentLine=70330" for 127.0.0.1 at 2016-04-19 14:24:29 +0530
ActionController::RoutingError (No route matches [GET] "/logs/development/changes.json"):
actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in
call'
railties (3.2.13) lib/rails/rack/logger.rb:32:in call_app' railties (3.2.13) lib/rails/rack/logger.rb:16:in
block in call'
activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in tagged' railties (3.2.13) lib/rails/rack/logger.rb:16:in
call'
quiet_assets (1.1.0) lib/quiet_assets.rb:27:in call_with_quiet_assets' actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in
call'
rack (1.4.7) lib/rack/methodoverride.rb:21:in call' rack (1.4.7) lib/rack/runtime.rb:17:in
call'
activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.4.7) lib/rack/lock.rb:15:in
call'
actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in call' railties (3.2.13) lib/rails/engine.rb:479:in
call'
railties (3.2.13) lib/rails/application.rb:223:in call' rack (1.4.7) lib/rack/content_length.rb:14:in
call'
railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in call' thin (1.6.4) lib/thin/connection.rb:86:in
block in pre_process'
thin (1.6.4) lib/thin/connection.rb:84:in catch' thin (1.6.4) lib/thin/connection.rb:84:in
pre_process'
thin (1.6.4) lib/thin/connection.rb:53:in process' thin (1.6.4) lib/thin/connection.rb:39:in
receive_data'
eventmachine (1.2.0.1) lib/eventmachine.rb:194:in run_machine' eventmachine (1.2.0.1) lib/eventmachine.rb:194:in
run'
thin (1.6.4) lib/thin/backends/base.rb:73:in start' thin (1.6.4) lib/thin/server.rb:162:in
start'
rack (1.4.7) lib/rack/handler/thin.rb:13:in run' rack (1.4.7) lib/rack/server.rb:268:in
start'
railties (3.2.13) lib/rails/commands/server.rb:70:in start' railties (3.2.13) lib/rails/commands.rb:55:in
block in <top (required)>'
railties (3.2.13) lib/rails/commands.rb:50:in tap' railties (3.2.13) lib/rails/commands.rb:50:in
<top (required)>'
script/rails:6:in require' script/rails:6:in
Rendered /Users/santu/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (59.6ms)
Any chance ? Or could I pr ?
Gem version pulled from RubyGems doesn't have attr_accessor :allow_production_logs, :allowed_log_files
code.
Please update.
It will be good to have the option to disable auto-refresh.
I want to scroll the log up to analise it and the page keeps scrolling down automatically.
Hi,
I recently installed browserlog
and I 'm getting the following error.
undefined method
[]' for nil:NilClass`
What's the easiest way to fix this error?
Hi,
I have tried to use this gem on a project using Ruby on Rails 3.2.18. In digging in the backtraces, this gem seems not compatible with Rails 3.2.18.
The first error says:
NoMethodError: undefined method `finish' for #SelectiveLogger:0x007fe4020eae00
from the code:def call_app(request, env) # Put some space between requests in development logs. if SKIP_PATHS.any? { |path| env['PATH_INFO'].include?(path) } @app.call(env) else default_behaviour(request, env) end rescue Exception finish(request) raise ensure ActiveSupport::LogSubscriber.flush_all! endI think, there is because the
finish
method isn't defined in Ruby on Rails 3.2.18.
Even if, I add logger before the call of the method, I got a second error:
undefined method `development?' for #SelectiveLogger:0x007fe4020eae00
The associated code is:
def default_behaviour(request, env)
if development?
logger.debug ''
logger.debug ''
end
instrumenter = ActiveSupport::Notifications.instrumenter
instrumenter.start 'request.action_dispatch', request: request
logger.info started_request_message(request)
resp = @app.call(env)
resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
resp
end
I don't understand the use of the lines of code:
if development?
logger.debug ''
logger.debug ''
end
When I comment this piece of code, I got a third error which is:
undefined method `start' for #ActiveSupport::Notifications::Instrumenter:0x007ffeeb4a20a8
This gem seems very useful but is in unusable state for 3.2.18 Rails project because the methods used aren't implemented in Rails 3.2.x.
However, good work and very useful for my developments. ๐
I thinks, showing logs to everyone on production - it is not good idea. Something like this:
before_filter :authenticate unless Rails.env.development?
protected
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == USER_FROM_CONFIG && password == PASSWORD_FROM_CONFIG
end
end
Is there any particular reason Browserlog::ApplicationController inherits from ActionController::Base instead of the host application's ApplicationController?
Inheriting from ApplicationController would allow those who use this gem to implement their own authentication strategy more easily. Take a look at: http://edgeguides.rubyonrails.org/engines.html#using-a-controller-provided-by-the-application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.