Commits

dizzyd committed c85b43a

Adding logging support to riak-admin

Comments (0)

Files changed (2)

rel/overlay/bin/riak-admin

                        -eval "riak_backup:$ACTION('$NODE', \"$FILENAME\")" -s init stop
         ;;
 
+    logger)
+        shift
+
+        if [ $# -lt 2 ]; then
+            echo "Usage:"
+            echo "    Log to console: $SCRIPT logger <node> <cookie>"  
+            echo "    Log to file:    $SCRIPT logger <node> <cookie> <filename>"  
+            exit 1
+        fi
+
+        NODE=$1
+        COOKIE=$2
+        FILENAME=$3
+
+        $ERTS_PATH/erl -noshell -name riak_logger -setcookie $COOKIE \
+                       -eval "riak_event_logger:start('$NODE', \"$FILENAME\")."            
+        ;;
+
     *)
-        echo "Usage: $SCRIPT { join <node> }"
+        echo "Usage: $SCRIPT { join | backup | restore | logger }"
         exit 1
         ;;
 esac

start-logger.sh

-#!/usr/bin/env bash
-# ./start-eventer.sh <node> <cookie>
-# ./start-eventer.sh <node> <cookie> <filename>
-
-# This will join the cluster via the node <node> using the cookie <cookie>
-# and optionally log results to filename <filename>.
-if [ $# -lt 2 ]; then
-    echo Usage: 1>&2
-    echo "    Log to console: `basename $0` <node> <cookie>"  1>&2
-    echo "    Log to file:    `basename $0` <node> <cookie> <filename>"  1>&2
-    exit 1
-fi
-. riak-env.sh
-NODE=$1
-COOKIE=$2
-FILENAME=$3
-erl -noshell -pa deps/*/ebin -pa ebin -name riak_logger -setcookie $COOKIE -eval "riak_event_logger:start('$NODE', \"$FILENAME\")."