Skip to content

Instantly share code, notes, and snippets.

@LeoHChen
Created January 28, 2022 08:18
Show Gist options
  • Save LeoHChen/475964e86127afd7a9f00f679482bd64 to your computer and use it in GitHub Desktop.
Save LeoHChen/475964e86127afd7a9f00f679482bd64 to your computer and use it in GitHub Desktop.
change log level for harmony node

Harmony node program support dynamic log level setting.

There is an RPC method supported by the node to dynamically adjust the log level. hmy_setLogVerbosity

Noted, the DebugEnabled configuration has to be set to true to enable this rpc call.

[RPCOpt]
  DebugEnabled = true

#-------

The default log level is 3, INFO.

If you want to expose more detailed log, you may set it to 5 using the following command. Run it on the server,

curl -H "Content-Type: application/json" -d '{"method":"hmy_setLogVerbosity","params":[5],"id":1}' http://127.0.0.1:9500

If you want to see less log, you may set it to 2 or even 1.

curl -H "Content-Type: application/json" -d '{"method":"hmy_setLogVerbosity","params":[2],"id":1}' http://127.0.0.1:9500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment