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
This commit is contained in:
Michael Vines
2019-08-10 22:54:46 -07:00
committed by GitHub
parent 799d3b1575
commit 54f4d13350
5 changed files with 73 additions and 12 deletions

27
scripts/set-log-filter.sh Executable file
View File

@ -0,0 +1,27 @@
#!/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\"]
}
"