aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-05-04 12:31:34 +1200
committerMichael Koziarski <michael@koziarski.com>2008-05-04 12:31:34 +1200
commit437f918646fd141fd57350f55a8890b18ebfb148 (patch)
tree78d9c4ff425f76c635eb4d312909b0f5d96e992c /railties
parent205750c8dead2449a23173fab0720b7701231d2a (diff)
downloadrails-437f918646fd141fd57350f55a8890b18ebfb148.tar.gz
rails-437f918646fd141fd57350f55a8890b18ebfb148.tar.bz2
rails-437f918646fd141fd57350f55a8890b18ebfb148.zip
Allow custom loggers to work with script/server.
Instead of requiring the initializer and initializing the logger, create the file manually before tailing it. [atnan] Closes #8665 (trac)
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/commands/servers/mongrel.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb
index 5eb14bce1e..f59265e698 100644
--- a/railties/lib/commands/servers/mongrel.rb
+++ b/railties/lib/commands/servers/mongrel.rb
@@ -34,10 +34,10 @@ end
puts "=> Rails application starting on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
-parameters = [
- "start",
- "-p", OPTIONS[:port].to_s,
- "-a", OPTIONS[:ip].to_s,
+parameters = [
+ "start",
+ "-p", OPTIONS[:port].to_s,
+ "-a", OPTIONS[:ip].to_s,
"-e", OPTIONS[:environment],
"-P", "#{RAILS_ROOT}/tmp/pids/mongrel.pid"
]
@@ -50,12 +50,12 @@ else
start_debugger if OPTIONS[:debugger]
- require 'initializer'
- Rails::Initializer.run(:initialize_logger)
-
puts "=> Call with -d to detach"
puts "=> Ctrl-C to shutdown server"
- tail_thread = tail(Pathname.new("#{File.expand_path(RAILS_ROOT)}/log/#{RAILS_ENV}.log").cleanpath)
+
+ log = Pathname.new("#{File.expand_path(RAILS_ROOT)}/log/#{RAILS_ENV}.log").cleanpath
+ open(log, (File::WRONLY | File::APPEND | File::CREAT)) unless File.exist? log
+ tail_thread = tail(log)
trap(:INT) { exit }