solana/scripts/set-log-filter.sh
Michael Vines 54f4d13350
Validator log filter may now be reconfigured at runtime (#5473)
* Log filter may now be reconfigured at runtime

* Add RPC API and bash script to reconfigure the log filter
2019-08-10 22:54:46 -07:00

28 lines
477 B
Bash
Executable File

#!/usr/bin/env bash
#
# Reconfigures the log filter on a validator using the current RUST_LOG value
#
if [[ -n $1 ]]; then
url=$1
else
# Default to the local node
url=http://127.0.0.1:8899
fi
if [[ -z $RUST_LOG ]]; then
echo "RUST_LOG not defined"
exit 1
fi
set -x
exec curl $url -X POST -H "Content-Type: application/json" \
-d "
{
\"jsonrpc\": \"2.0\",
\"id\": 1,
\"method\": \"setLogFilter\",
\"params\": [\"$RUST_LOG\"]
}
"