summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-11-23 10:25:16 +0100
committerAzul <azul@riseup.net>2013-11-23 10:25:16 +0100
commitfd648d3fe7c4573974ce1e554256896057dcd8f2 (patch)
treea7267515cd4a169f9ab2a82cbd888af1c4634732 /files
parent76285091613959e81ee8c1eca8d224d592474d95 (diff)
fixed couch-doc-update: log errors to stderr and syslog (#4225)
Diffstat (limited to 'files')
-rw-r--r--files/couch-doc-update6
1 files changed, 5 insertions, 1 deletions
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