[SOLVED] How to change LogLevel via "rc"

I am trying to do some quick troubleshooting and was wondering if it was possible to change the log level via the “rc” command. This would be useful to monitor logs then change back once you got your debug info quickly versus having to do the config file change dance especially on a mount command.
I tried things like

rclone rc options/set main=LogLevel:10
rclone rc options/set LogLevel=10:

I don’t believe so.

All the commands are listed here:

https://rclone.org/rc/

You can always open up an issue with a feature request for that as well.

That should work. You’ll need to use the JSON syntax though

rclone rc options/set --json '{"main": {"LogLevel": 10}}'
1 Like

Works great thanks again !

Are there more commands like that? I can work on a request to update the docs as that’s super helpful as I didn’t know it existed either!

10 would be DEBUG. What would the other levels be?

This is documented here: https://rclone.org/rc/#options-set-set-an-option

I’d be the first to admit that the documentation is a bit sketchy though! I put those commands in to make it possible for people to set options via the rc. They are are options you can set which won’t do anything, however setting LogLevel will work.

What you do is first do options/get to list all the options with their current values. You can they use options/set to set options. These commands have nested objects so you need to use the JSON syntax.

The actual log levels are these (not all used by rclone)

	LogLevelEmergency LogLevel = 0
	LogLevelAlert = 1
	LogLevelCritical = 2
	LogLevelError = 3 // Error - can't be suppressed
	LogLevelWarning = 4
	LogLevelNotice = 5 // Normal logging, -q suppresses
	LogLevelInfo  = 6 // Transfers, needs -v
	LogLevelDebug  = 7 // Debug level, needs -vv

Note that the rc documentation is built from the source

Have a play - see what you can do!

1 Like