similar to: Rails logger doesn't log nil, Ruby logger does

Displaying 20 results from an estimated 11000 matches similar to: "Rails logger doesn't log nil, Ruby logger does"

2008 Jun 12
1
how do I mock the Rails Logger with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2008 Jun 12
1
Does anyone know how to mock the Rails Logger then set expectations with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2005 Dec 16
2
Using logger from rails cron jobs
Hi. I''m trying to use logger from a rails cron job. It works fine, but I''d like the standard ruby behavior of stamping each log with date and time. How do I do this? I''m trying: # Set up out logging require ''logger'' logger = Logger.new(STDERR) logger.level = Logger::INFO RAILS_DEFAULT_LOGGER = logger # Tell rails to log to our logger also The
2005 Dec 14
0
Fwd: Logger bug in 0.14.3 ?
Hello All, I am top-posting this in hopes of increasing the visibility. This ticket has not been touched : Default Logger instance has no formatting <http://dev.rubyonrails.org/ticket/3144> For my installation, this is a BIG problem in my production logging !! For now the workaround below is working, and the double-declaration warnings of loading ''logger.rb'' twice are
2006 Jan 11
1
logger in my classes
Hi, I wrote a class which is not an AR extension, nor a controller. I''d like to use logger.* methods there too. My class is in lib/ dir. I include it in environment.rb with the line require ''lib/localization'' just after the line require File.join(File.dirname(__FILE__), ''boot'') I tried many ways to reuse the logger class. The cleaner way seemed to
2007 May 21
2
logger anybody?
Hello, When trying to use logger into any RSpec I get: logger anyboundefined local variable or method `logger'' for #<#<Class:0x278bee0>:0x253cdec> Not sure if this is the spected behaviour (haven''t checked under the hood) It was just annoying not having a logger instance available as in Rails out of the tests. -- An?bal Rojas http://www.rubycorner.com
2006 May 17
1
ActiveRecord vs logger
Appendix B.1 of the Agile book says you can configure as follows: B.1 Active Record Configuration ActiveRecord::Base.logger =logger Accepts a logger object. This is used internally to record database activity. It is also available to applications that want to log activity. Yet, as far as I know, there is no way to use logger.info and friends within a model. Is there? Or is this simply
2005 Sep 20
1
Javascript Logger and Console
Hey, I put together a javascript logger and console that has made my coding life a breeze, so I thought I would share it with you guys. Check out the demo http://gleepglop.com/javascripts/logger/ Some features are... - Toggle button so it is visiable when you need it and out of the way when you don''t. - Auto-positions itself at the bottom of the window so output is easy to read. -
2010 Apr 15
1
Using Rails.Logger in a gem in Rails 3beta3
Hi fellows! I want to use the Rails.logger in my gem. I try the following code in my main gem-file. require ''rails/logger'' puts "init1" ::Rails.logger.info("hi") puts "init2" The funny thing is: It even don''t give me the output of puts in the stdout of the server! But if I remove the call to Rails.logger the puts are displayed in the
2006 Jun 07
0
Logger in ActionWebService::Base?
I''d like to split up my directly dispatched controller into a layered dispatch setup with one controller and two services derived from ActionWebService::Base. However, in doing this I found that logger is not a class_variable of AWS::Base. This kind of scares me away from using the layered dispatch mode, as I''d like to have logging in the method implementations. Is there a clean
2006 Jun 20
0
Quiet the Logger in 1.1
I''m using Rails 1.1 and I''m trying to quiet the logger. I searched the mailing list and placed the following inside my environment.rb: RAILS_DEFAULT_LOGGER.level = (RAILS_ENV == ''production'' ? Logger::INFO : Logger::DEBUG) But I keep getting: /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing'':
2005 Dec 29
2
Access rails logger from plain class
How can I "get" the rails logger from a plain class, that is a class that does not inherit from a rails class? I have tried using RAILS_DEFAULT_LOGGER (see below) but it''s nil class MyClass logger = RAILS_DEFAULT_LOGGER def myMethod logger.debug("stuff...") end end -- Posted via http://www.ruby-forum.com/.
2006 May 22
0
logger and ActionWebService - how can I get them to work together?
I''m adding a web service to a small Rails app that I wrote to learn the framework. This is my last piece of the puzzle and I''m having trouble figuring out how to debug it. I was attempting to iteratively develop the web service method using TDD. There''s so much coercion and stuff going on via the ActionWebService framework that I''m looking to fall-back
2005 Dec 09
0
Default Logger -> Database log
Hi listers, I''m trying to save my log entries in the database using the following technique : http://wiki.rubyonrails.com/rails/pages/DatabaseLoggerWish I''ve added the following code to the Environment.rb : ---------------------------------------------------------------------------- begin RAILS_DEFAULT_LOGGER = DBErrorLogger.new() rescue StandardError
2014 Oct 23
1
logger.conf
with the below defined in logger.conf on 11.6 cert 6 I am not getting any log message other than notice and warning in any files when doing module reload logger - queue log is the only one that says it restarts *CLI> module reload logger == Parsing '/etc/asterisk/logger.conf': Found Asterisk Queue Logger restarted built fresh box with make samples - added 2 stations, dialing from
2010 Jun 07
2
Trying to get N1MM Logger working under Wine
I am trying to use an amateur radio logging program under Wine, but other than installation, I've been unable to get the program running. Most likely I just need some assistance figuring out which DLLs are still missing. On advice I installed DCOM98 and VCRUN6 and set mfc42, ole32 and rpcrt4 to (builtin, native). So far all I get are a few dialog boxes, the first titled "EntryWindow
2020 Jun 03
2
problem with logger: syslog vs. file
On Wed, 3 Jun 2020, Fourhundred Thecat wrote: >> On 2020-06-03 12:18, Tony Mountifield wrote: >> In article <88f96e46-e6bb-a7ef-bebb-5588ef6cd6c1 at gmx.ch>, >> >> However, the conversation would then be: should both logging types include >> line number and function? should both logging types omit them? should >> it be a configuration option in
2014 Mar 04
2
Pipe into logger duplicates messages in /var/log/messages
I am trying to pipe the output from a process into syslog using the logger command. Initially I pipe the output into a separate file, but as it happens this filled up the disk when things went wrong. So I figured I redirect the output to syslog and let logrotate deal with the roll-over and archive of the file. However the following command : echo "HI" > logger -t test Resulted in
2006 Jun 09
1
logrotate and logger reload
I have one system that went totally crazy on me. It went into an infinite loop rotating * message and log files. From the asterisk console I kept seeing the message about re-loading logger.conf over and over and it just kept creating more and more files. I baby set many different * boxes all running the same script without this problem. Here is my cron script: /var/log/asterisk/cdr-csv/*csv {
2006 Aug 12
0
params object NULL/nil in controller - is this a bug?
Hi All I am trying to implement a functionality where a user clicks on "Back to Search Results" link he is taken to the back to search result screen. For this I am storing his search criteria (params object) in session. Below is my code, for the first time when the user performs a search, there is no result data in session so the execution enters first if...... see below