Displaying 9 results from an estimated 9 matches for "bufferedlogger".
2008 Nov 17
0
custom format with BufferedLogger?
So Rails2 provides a new BufferedLogger class that is used for logging.
The old monkey-patched Logger class is deprecated.
It''s nice that the new BufferedLogger doesn''t do that weird monkey
patching thing, making it easier to sub-class for custom behavior and
set your sub-class as the logger, etc.
But oddly, BufferedL...
2012 Oct 25
0
[Rails 3.2.8] ActiveSupport::BufferedLogger extension, undefined_method
I tried to extend it , with this class , loaded at config time :
config.autoload_paths += Dir["#{config.root}/lib",
"#{config.root}/lib/**/", "#{config.root}/app/inputs"]
lib/extension.rb
class ActiveSupport::BufferedLogger
def detailed_error(e)
error(e.message)
e.backtrace.each{|line| error line }
end
end
but calling it in my controller
rescue ActiveRecord::RecordInvalid
logger.detailed_error($!)
raises an error => undefined method `detailed_error'' for
#<Logger:0x007fb8ecaabcc8>...
2009 Apr 30
3
Logging - using a different log for one method
Hi there,
I''m wondering if there''s a way to have any log statements generated
from a specific method on a model get logged into a separate file from
the normal development/production log files?
i.e. I want the whole app to log as normal, apart from the
Sprinter.run_often method, which I''d like to log to
sprinter_running.log
Cheers,
Tim.
2008 Jun 24
9
ActiveRecord 2.1 Migration support
...ce that would
cause the call not to work. Below is a dump of "options" using ruby-debug:
MySQL
{:default=>nil,
:column=>#<struct ActiveRecord::ConnectionAdapters::ColumnDefinition
base=#<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb6fc6f50
@logger=#<ActiveSupport::BufferedLogger:0xb70935f0
@log=#<File:/home/grant/stuff/ruby/rails/auction-demo-mysql/log/development.log>,
@no_block=false,
@auto_flushing=1,
@buffer=[],
@level=0>,
@runtime=0.134179830551147,
@quoted_column_names={"unique_schema_migrations"=>"`unique_schema_migrations`",...
2008 Jun 24
9
ActiveRecord 2.1 Migration support
...ce that would
cause the call not to work. Below is a dump of "options" using ruby-debug:
MySQL
{:default=>nil,
:column=>#<struct ActiveRecord::ConnectionAdapters::ColumnDefinition
base=#<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb6fc6f50
@logger=#<ActiveSupport::BufferedLogger:0xb70935f0
@log=#<File:/home/grant/stuff/ruby/rails/auction-demo-mysql/log/development.log>,
@no_block=false,
@auto_flushing=1,
@buffer=[],
@level=0>,
@runtime=0.134179830551147,
@quoted_column_names={"unique_schema_migrations"=>"`unique_schema_migrations`",...
2008 Nov 22
3
rawk no longer works on Rails 2.2.2
I just wanted to let you know that the hack to make rawk work on Rails
2.2.2 by grouping action calls no longer works.
This is the hack, I have put the TODO where the line crashes Rails:
--
module ActiveSupport
class BufferedLogger
def add(severity, message = nil, progname = nil, &block)
return if @level > severity
message = (message || (block && block.call) || progname).to_s
# If a newline is necessary then create a new message ending with
a newline.
# Ensures that the original mess...
2008 Feb 19
0
Rails logger change format
Hi guys,
After few investigations I still cannot change the format of logs from
rails 2.0.2 apps.
I tried with overwriting the format_message method from Logger class and
still nothing. I know that in Rails 2.0.2 BufferedLogger is used and I
didn''t manage to change the format for this one.
What seems to be the easiest way to do that ?
Thanks in advance.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Go...
2010 Aug 09
0
Logging form delayed job class
I have asked this before without any luck, trying again.
this is what I have in my dj.rb initializer
Delayed::Worker.backend = :active_record
Delayed::Worker.logger = Rails.logger
#Delayed::Worker.logger = ActiveSupport::BufferedLogger.new("log/
##{Rails.env}_delayed_jobs.log", Rails.logger.level)
class Delayed::Job
def logger
Delayed::Worker.logger
end
end
if JobsCommon::check_job_exists("PeriodicJob").blank?
Delayed::Job.enqueue PeriodicJob.new(), 0,
Constants::PROCESS_FREQ.from_now
end
#...
2010 Jan 18
5
Re: puts & logger ... flush immediately
Marnen Laibow-Koser wrote:
> Ralph Shnelvar wrote:
>> newbie here ...
>>
>> I am tracing logic putting puts and logger.info calls in my code.
>>
>> I _think_ Rails is buffering output so that I can''t see what happens
>> until I close out webrick.
>
> But you are probably wrong. If you watch the log scroll by, you will
> generally see