Nebula uses glog to print logs, gflag to control the severity level of the log, and provides an HTTP interface to dynamically change the log level at runtime to facilitate tracking.
- minloglevel 0-4: the numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively. Usually specified as 0 in debug, 1 in production.
- v 0-4: when minloglevel is set to 0, you can further set the severity level of the debug log. The larger the value, the more detailed.
The default severity level for the metad, graphd, storaged logs can be found in the configuration files (usually under /usr/local/nebula/etc/
).
Check all the flag values (log values included) of the current glags with the following command.
> curl ${ws_ip}:${ws_port}/get_flags
Descriptions:
ws_ip
is the HTTP service ip, which can be found in the above config files (default is 127.0.0.1)ws_port
is the HTTP port, the default value formetad
is 11000,storaged
is 12000 andgraphd
is 13000
For example, check the severity minloglevel of storaged:
> curl 127.0.0.1:12000/get_flags | grep minloglevel
Change the logs severity level to most detailed with the following command.
> curl "http://127.0.0.1:12000/set_flags?flag=v&value=4"
> curl "http://127.0.0.1:12000/set_flags?flag=minloglevel&value=0"
Or close all logs print (FATAL only).
> curl "http://127.0.0.1:12000/set_flags?flag=minloglevel&value=4"