Keep the logging output of the EDI translator by default user/senator/edi-translator-logging
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 16 Aug 2011 13:10:45 +0000 (09:10 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 16 Aug 2011 13:16:55 +0000 (09:16 -0400)
There is valuable troubleshooting information there that is otherwise hard to
find.  This particularly matters when the output of an EDI
Action/Trigger template (JEDI) doesn't successfully get translated to
EDIFACT for nonobvious reasons.

In production environments, you might instead pipe to logger so that you can
collect output with syslog, rather than in a flat file.  As long as
output goes *somewhere.*

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/edi_translator/edi_webrick.bash

index 732d50a..9ecd731 100755 (executable)
@@ -16,8 +16,12 @@ script='./edi_webrick.rb';
 # This doesn't work?
 #      export RUBYLIB=$lib
 
+echo -n Starting translator in background with logging...
+
 # This is necessary 
-echo export RUBYOPT=rubygems
-     export RUBYOPT=rubygems
-echo ruby $script '&'
-     ruby $script &
+export RUBYOPT=rubygems
+
+# Instead of logging to file, one could pipe to the logger command.
+ruby $script --verbose >> /openils/var/log/edi_webrick.log 2>&1 &
+
+echo done.