Skip to content

Conversation

@agodnic
Copy link

@agodnic agodnic commented Dec 8, 2025

Summary

This pull request introduces the endpoint POST /v2/node/log-level, which lets operators set the node's log level.

Example

$ curl -Ss -H "X-Algo-API-Token: $(cat ~/.algorand/algod.admin.token)" 'http://127.0.0.1:8080/v2/node/log-level' -X POST -d '{"log-level": "info"}' -v
*   Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /v2/node/log-level HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.81.0
> Accept: */*
> X-Algo-API-Token: 27ce0afafdb106203e67541c0ad76d5ee1307a0a1b3e006d0b4c1129d547b936
> Content-Length: 21
> Content-Type: application/x-www-form-urlencoded
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Vary: Accept-Encoding
< Vary: Origin
< Date: Sun, 07 Dec 2025 23:49:53 GMT
< Content-Length: 0
< 
* Connection #0 to host 127.0.0.1 left intact

@agodnic agodnic requested a review from urtho December 8, 2025 00:07
@agodnic agodnic self-assigned this Dec 8, 2025
@urtho
Copy link
Member

urtho commented Dec 8, 2025

There is also a Trace level in logrus - not used atm but lets add it anyway.

@urtho
Copy link
Member

urtho commented Dec 8, 2025

Logging will be split into many subsystems eventually so lets add "mask" (no idea about the name) param that has:
all,main,libp2p values for now that allows to choose which subsystems log level is to be changed.

Also calling the endpoints with a mask param but no log-level param should reset the logging to default value.

@agodnic
Copy link
Author

agodnic commented Dec 11, 2025

libp2p subsystem was removed.

This is a sample of what an API call would look like:

curl -Ss \
'http://127.0.0.1:8080/v2/node/log-level' \
-X POST \
-H "X-Algo-API-Token: $(cat ~/.algorand/algod.admin.token)" \
-d '{"mask": [{"subsystem": "main", "log-level": "error"}]}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants