Alex
2013-Nov-14 09:15 UTC
rails server should optionally log to console the full exception stack trace
AFAICT, it''s not possible to force this currently. Frequently the application trace is inadequate and you need the full trace to get to the bottom of the problem. For example, let''s say your layout template calls non application (3rd party gem) code which raises. The application trace will consist of a single entry, the template being rendered. actionpack-4.0.1/lib/action_dispatch/middleware/debug_exceptions.rb ___________________________________________ def log_error(env, wrapper) logger = logger(env) return unless logger exception = wrapper.exception trace = wrapper.application_trace trace = wrapper.framework_trace if trace.empty? ActiveSupport::Deprecation.silence do message = "\n#{exception.class} (#{exception.message}):\n" message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code) message << " " << trace.join("\n ") logger.fatal("#{message}\n\n") end end ___________________________________ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.
Alex
2013-Nov-18 20:27 UTC
Re: rails server should optionally log to console the full exception stack trace
So, would this, in principle, be good to add? On Thursday, November 14, 2013 4:15:57 AM UTC-5, Alex wrote:> > AFAICT, it''s not possible to force this currently. > > Frequently the application trace is inadequate and you need the full trace > to get to the bottom of the problem. For example, let''s say your layout > template calls non application (3rd party gem) code which raises. The > application trace will consist of a single entry, the template being > rendered. > > > actionpack-4.0.1/lib/action_dispatch/middleware/debug_exceptions.rb > ___________________________________________ > def log_error(env, wrapper) > logger = logger(env) > return unless logger > > exception = wrapper.exception > > trace = wrapper.application_trace > trace = wrapper.framework_trace if trace.empty? > > ActiveSupport::Deprecation.silence do > message = "\n#{exception.class} (#{exception.message}):\n" > message << exception.annoted_source_code.to_s if > exception.respond_to?(:annoted_source_code) > message << " " << trace.join("\n ") > logger.fatal("#{message}\n\n") > end > end > ___________________________________ >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.
richard schneeman
2013-Nov-18 21:57 UTC
Re: Re: rails server should optionally log to console the full exception stack trace
It could be useful, cannot auto accept the idea without code. Potentially I would want to configure this via ENV var. — Sent from Mailbox for iPhone On Mon, Nov 18, 2013 at 2:27 PM, Alex <alxtskrnk@gmail.com> wrote:> So, would this, in principle, be good to add? > On Thursday, November 14, 2013 4:15:57 AM UTC-5, Alex wrote: >> >> AFAICT, it''s not possible to force this currently. >> >> Frequently the application trace is inadequate and you need the full trace >> to get to the bottom of the problem. For example, let''s say your layout >> template calls non application (3rd party gem) code which raises. The >> application trace will consist of a single entry, the template being >> rendered. >> >> >> actionpack-4.0.1/lib/action_dispatch/middleware/debug_exceptions.rb >> ___________________________________________ >> def log_error(env, wrapper) >> logger = logger(env) >> return unless logger >> >> exception = wrapper.exception >> >> trace = wrapper.application_trace >> trace = wrapper.framework_trace if trace.empty? >> >> ActiveSupport::Deprecation.silence do >> message = "\n#{exception.class} (#{exception.message}):\n" >> message << exception.annoted_source_code.to_s if >> exception.respond_to?(:annoted_source_code) >> message << " " << trace.join("\n ") >> logger.fatal("#{message}\n\n") >> end >> end >> ___________________________________ >> > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. > To post to this group, send email to rubyonrails-core@googlegroups.com. > Visit this group at http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.