better logging

This commit is contained in:
David Dollar
2010-05-17 13:11:10 -04:00
parent 2dbd3e6be5
commit 0f2048e345
6 changed files with 8 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
example/log/*

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
puts "sleeping for 2s then dying"
sleep 2
exit 0

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
puts "will error in 10s"
sleep 10
raise "Dying"

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env ruby
while true
puts "tick"
$stdout.flush
sleep 5
end

View File

@@ -47,7 +47,8 @@ private ######################################################################
proctitle "ruby: foreman #{process.name}"
Dir.chdir directory do
system process.command
FileUtils.mkdir_p "log"
system "#{process.command} >>log/#{process.name}.log 2>&1"
exit $?.exitstatus || 255
end
end

View File

@@ -47,7 +47,7 @@ stop on stopping #{name}
respawn
chdir #{engine.directory}
exec #{process.command} 2>&1 > /var/log/#{name}/#{process.name}.log
exec #{process.command} >>/var/log/#{name}/#{process.name}.log 2>&1
UPSTART_CHILD
end
end