From fd648d3fe7c4573974ce1e554256896057dcd8f2 Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 23 Nov 2013 10:25:16 +0100 Subject: fixed couch-doc-update: log errors to stderr and syslog (#4225) --- files/couch-doc-update | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'files') diff --git a/files/couch-doc-update b/files/couch-doc-update index 7cc5799..625847f 100644 --- a/files/couch-doc-update +++ b/files/couch-doc-update @@ -1,4 +1,5 @@ #!/usr/bin/ruby +require 'syslog' # # This script will update the values of a particular couchdb document. The benefit of this little script over @@ -37,7 +38,10 @@ def main exit 0 if result['ok'] raise StandardError.new(result.inspect) rescue StandardError => exc - puts "ERROR: " + exc.to_s + $stderr.puts "ERROR: " + exc.to_s + Syslog.open do |logger| + logger.log(Syslog::LOG_CRIT, exc.to_s) + end exit 1 end -- cgit v1.2.3