Logs¶
Nebula Graph uses glog to print logs, uses 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.
Log Directory¶
The default log directory is /usr/local/nebula/logs/
.
NOTE: If you deleted the log directory during runtime, the runtime log would not continue to be printed. However, this operation will not affect the services. Restart the services to recover the logs.
Parameter Description¶
Two most commonly used flags in glog¶
- minloglevel: The scale of minloglevel is 0-4. The numbers of severity levels INFO(DEBUG), WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively. Usually specified as 0 for debug, 1 for production. If you set the minloglevel to 4, no logs are printed.
- v: The scale of v is 0-3. When the value is set to 0, you can further set the severity level of the debug log. The greater the value is, the more detailed the log is.
Configuration Files¶
The default severity level for the metad, graphd, and storaged logs can be found in the configuration files (usually in /usr/local/nebula/etc/
).
Check and Change the Severity Levels Dynamically¶
Check all the flag values (log values included) of the current gflags with the following command. curl
is only available when the local_config
parameter is set to true
.
> curl ${ws_ip}:${ws_port}/get_flags
In the command:
ws_ip
is the IP address for the HTTP service, which can be found in the configuration files above. The default value is 127.0.0.1.ws_port
is the port for the HTTP service, the default values formetad
,storaged
, andgraphd
are 11000, 12000,and 13000, respectively.
For example, check the minloglevel for the storaged
service:
> curl 127.0.0.1:12000/get_flags | grep minloglevel
You can also change the logs' severity level to the 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"
In the Nebula console, check the severity minloglevel of graphd and set it to the most detailed with the following commands.
nebula> GET CONFIGS graph:minloglevel;
nebula> UPDATE CONFIGS graph:minloglevel=0;
To change the severity of the storage log, replace the graph
in the preceding command with storage
.
NOTE: Nebula Graph only supports modifying the graph and storage log severity by using console. And the severity level of meta logs can only be modified with the
curl
command.
Close all logs print (FATAL only) with the following command.
> curl "http://127.0.0.1:12000/set_flags?flag=minloglevel&value=4"