forked from couchbase/ns_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cbbrowse_logs
executable file
·38 lines (32 loc) · 1.13 KB
/
cbbrowse_logs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# Copyright 2011-Present Couchbase, Inc.
#
# Use of this software is governed by the Business Source License included in
# the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that
# file, in accordance with the Business Source License, use of this software
# will be governed by the Apache License, Version 2.0, included in the file
# licenses/APL2.txt.
# All rights reserved.
COUCHBASE_BIN="$(cd "$(dirname "$0")" && pwd)"
COUCHBASE_TOP="$COUCHBASE_BIN/.."
export COUCHBASE_TOP
PATH="$COUCHBASE_BIN":$PATH
export PATH
ERL_LIBS="$COUCHBASE_TOP/lib/couchdb/erlang/lib:$COUCHBASE_TOP/lib/ns_server/erlang/lib"
export ERL_LIBS
if [ x"$1" != "x" ]
then
extra_args="-log $1"
fi
if [ x"$REPORT_DIR" = x ]
then
REPORT_DIR="$COUCHBASE_TOP/var/lib/couchbase/logs"
if [ "x$(ls "$REPORT_DIR")" = "x" ]
then
# If the usual logs dir is empty, try the usual OSX logs location...
REPORT_DIR=~/Library/Application\ Support/Couchbase/var/lib/couchbase/logs
fi
fi
exec erl -pa ebin -noshell -run ns_log_browser \
-report_dir "${REPORT_DIR}" ${extra_args} \
-run init stop -- "$@"