better logging
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
example/log/*
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
puts "sleeping for 2s then dying"
|
||||
sleep 2
|
||||
exit 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
puts "will error in 10s"
|
||||
sleep 10
|
||||
raise "Dying"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
while true
|
||||
puts "tick"
|
||||
$stdout.flush
|
||||
sleep 5
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user