Displaying 20 results from an estimated 55 matches for "rails_default_logger".
2006 Jul 10
7
How to obscure/encrypt password parameter?
Hi all-
I am building an application that includes a login screen. During
development I found that user passwords are logged by Rails in plain
text -- this will not be acceptable to my users. Is there a way to
obscure/encrypt incoming password parameters or not write them to the
log files at all? One thought was to use Javascript, but I was not sure
how secure that would be.
Thanks,
Josh
2007 Apr 01
8
No stacktrace on errors (edge rails)
Hi,
I must be missing something or have something misconfigured, but I
get no stack-trace when there is an error in the code behind a view.
If the view doesn''t compile, then I see an error & stacktrace, but
all other errors I get a "lost network connection" from the browser,
and nothing at all in the server output or development.log.
It''s been that way with
2006 Jan 11
1
logger in my classes
...o.
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
be based on Object::RAILS_DEFAULT_LOGGER that is defined in
/railties/lib/initializer.rb:
silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger }
But all I get is an uninitialized constant :(
Please tell me the right way to reuse logger.
--
Jean-Christophe Michel
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/.
2005 Dec 09
0
Default Logger -> Database log
...'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
RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
RAILS_DEFAULT_LOGGER.level = Logger::WARN
RAILS_DEFAULT_LOGGER.warn(
"Rails Error: Unable to access log database. Please ensure that your database settings are exact &q...
2006 Jan 06
10
I need debugging tips?
Hi all,
Like most other frameworks, Ruby groups code by Model/View/Controller instead
of by task, and therefore I''m having a hard time debugging a problem from the
Agile Rails book where looping through @items errors out because one or more
items is nil.
I managed to empty the cart by placing session[:cart] = nil in find_cart() in
the store_controller_rb, and the problem continued
2006 Apr 04
2
Default logger inside arbitrary classes
Hi,
What''s the best way to get the default logger (the one used during the tests) from inside a class that doesn''t inherit any rails class?
Thanks
Oscar
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jan 12
3
How to Selectively Quite SQL Logging
...r.silence but here is the issue: I''m comfortable with
the way the user engine is working, but it generates quite a bit of SQL
noise in the logs. I''d like, for that engine, to suppress the SQL
logging.
Code in it has return statements in conditionals, e.g.,
if !user?
RAILS_DEFAULT_LOGGER.debug "checking guest authorisation for
#{controller}/#{action}"
if User.guest_user_authorized?(controller, action)
yield block if block != nil
return true
end
else
RAILS_DEFAULT_LOGGER.debug "checking user:#{session[:user].id}
authorisation fo...
2006 Apr 11
2
using log4r and rails
hey everyone. i know somebody else had started a thread on this subject,
but since no one seems to be answering that thread i thought i would
start one of my one.
i''m doing a project for a client and we need some seriously verbose
logging. it looks like log4r can do what i need, but i can''t for the
life of me figure out how to plug it into rails. everywhere talks about
how
2005 Dec 16
2
Using logger from rails cron jobs
...ng 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 logs show the messages fine, but no time stamps or severity level.
Thanks
--
Posted via http://www.ruby-forum.com/.
2006 Feb 24
5
Plain text passwords displayed in production.log
By default, all the paramaters are displayed in the production.log on a POST.
Unfortunately, this includes all the plain-text passwords that people type
into the login form on my application, which is a huge security risk. I''m
using a custom evaluation system that hooks into LDAP (not any of the
generators/plugins).
View code is simple:
<%= text_field ''employee'',
2006 Mar 02
5
Instiki and SQL Server??
...ipt/../config/environment.rb:23: warning:
already init
ialized constant RAILS_ENV
C:/software/instiki-ar/script/../config/environment.rb:26: warning:
already init
ialized constant ADDITIONAL_LOAD_PATHS
C:/software/instiki-ar/script/../config/environment.rb:73: warning:
already init
ialized constant RAILS_DEFAULT_LOGGER
C:/software/instiki-ar/script/../config/environment.rb:90: warning:
already init
ialized constant Controllers
Creating tables for production...
failed: #<RuntimeError: Unknown db type sqlserver>
C:/software/instiki-ar/script/../config/environment.rb:16: warning:
already init
ialized constant...
2008 Mar 12
3
a way to restrict who can install your app, for private testing
...t the top of your controller, at the end of
your filters.
# This filter is only until we open everything up
before_filter do |c|
acceptable_uids = [''594180515'', ''122612996'']
unless acceptable_uids.include? c.get_facebook_session.user.uid
RAILS_DEFAULT_LOGGER.debug "my UID = " +
c.get_facebook_session.user.uid + " but acceptable_uids = " +
acceptable_uids.to_s
raise RuntimeError("This isn''t going to work")
end
end
def get_facebook_session
@facebook_session
end
If it deems the user u...
2009 Feb 22
8
dynamically changing a form from POST/CREATE to PUT/UPDATE
For the life of me I can''t figure this one out, although I can''t find
anyone else who''s attempted to do this, and probably with good reason.
Context: blog using AJAX
What I''m trying to do: when the user initially saves a blog entry, or
when auto-saving, I want subsequent saves to not create a new blog
entry
Why I can''t just reload the partial:
-
2006 Mar 21
2
How do I get substring of utf-8 string?
I''m trying to get substring from a utf-8 encoded string. (say, first
50 characters of the string) String#[0..49] would give me the first
50 bytes not 50 characters..
I know there is jcode library, but it only let you count number of
characters in utf-8 string.
unicode gem doesn''t seem to help much. unicode_hacks gem seem to
solve the problem, but it also seems to
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'': uninitialized constant RAILS_DEFAULT_LOGGER (NameError)
from /usr/li...
2006 Jan 20
2
Logging from a functional (or unit) test
I''ve tried any number of ways to output information to the test log from
my tests, but nothing seems to work. Is there a setting someplace that I
am missing? I''m just trying to do something on the order of
logger.info "blah blah"
from my test.
TIA,
Keith
--
Posted via http://www.ruby-forum.com/.
2005 Oct 27
1
Logger datetime_format not working ?
I''m trying to configure logger in a rails app.
I added this to my environment.rb :
RAILS_DEFAULT_LOGGER.datetime_format = "%Y-%m-%d %H.%M.%s"
Yet, none of the entries in the development.log show the datestamp.
What can you tell me about this ?
Thanks.
Peter Fitzgibbons
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane...
2006 Aug 06
2
Rails logger: how to access it in a my own class
Hey Guys,
The only way I could find to access the Rails logger object was to
subclass from ApplicationController... can anyone suggest a more
sensible way of doing it?
Soroe.
--
Posted via http://www.ruby-forum.com/.
2008 Mar 06
5
Setting :canvas => false for URL generation doesn''t always work?
...ewriter#link_to_canvas? (in facebook_url_rewriting.rb) to
look like this:
def link_to_canvas?(params, options)
option_override = options[:canvas]
if option_override == false # important to check for false. nil should
use default behavior
options[:only_path] = false
RAILS_DEFAULT_LOGGER.debug "set options[:only_path] to false"
return false
end
option_override || @request.parameters["fb_sig_in_canvas"] == "1" ||
@request.parameters[:fb_sig_in_canvas] == "1"
end
The pertinent change is that if they sent canvas to fal...