# Set log settings per API call

**URL:** <https://forum.rclone.org/t/set-log-settings-per-api-call/27723>\
**Category:** Help and Support\
**Created:** [November 26, 2021, 10:34am UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723 "2021-11-26T10:34:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rourke](https://forum.rclone.org/user_avatar/forum.rclone.org/rourke/32/6260_2.png) [@Rourke](https://forum.rclone.org/u/Rourke)\
**Post date:** [November 26, 2021, 10:34am UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/1 "2021-11-26T10:34:34Z")

</div>

#### What is the problem you are having with rclone?

I'm running `rclone rcd` through the official docker container hosted on a Ubuntu Server machine. I'm sending rclone jobs from one container to the other through the rclone API. Communication between the containers is fine, but I want to set the log-level and log-file on a per request basis.

My end goal is to have 1 log file for this specific sync task that gets filled with output from my bash script and with rclone output. However I can't seem to get any output from rclone to the log file.

The sync goes perfect, and from within the rclone container I can read and write to the mounted `/config/rclone/duplicati.log`. But I don't see anything written to the log file. What am I doing wrong?

#### What is your rclone version (output from `rclone version`)

rclone v1.57.0

- os/version: alpine 3.14.2 (64 bit)
- os/kernel: 5.4.0-89-generic (x86\_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- go/linking: static
- go/tags: none

#### Which cloud storage system are you using? (eg Google Drive)

Google Drive

#### The command you were trying to run (eg `rclone copy /tmp remote:tmp`)

```bash
curl -s \
    -H "Content-Type: application/json" \
    -X POST \
    -d "${payload}" \
    "http://${rclone_user}:${rclone_pass}@${rclone_host}:${rclone_port}/sync/sync

```

Where the payload contains this JSON data:

```json
{
   "srcFs":"/data/backups/databases",
   "dstFs":"gdrive:/backups/databases",
   "createEmptySrcDirs":true,
   "_async":true,
   "_config":{
      "LogFile":"/config/rclone/duplicati.log",
      "LogLevel":"INFO"
   }
}

```

also tried:

```auto
{
   "srcFs":"/data/backups/databases",
   "dstFs":"gdrive:/backups/databases",
   "createEmptySrcDirs":true,
   "_async":true,
   "_config":{
      "main":{
         "LogLevel":"INFO"
      },
      "log":{
         "File":"/config/rclone/duplicati.log"
      }
   }
}

```

#### The rclone config contents with secrets removed.

```auto
[gdrive]
type = drive
client_id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
client_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scope = drive
root_folder_id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","expiry":"2021-11-26T13:41:15.394141915+01:00"}
team_drive =

```

#### A log from the command with the `-vv` flag

```auto
2021/11/26 13:47:08 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "rcd" "-vv" "--rc-web-gui" "--rc-addr=:5572" "--cache-dir=/config/rclone/cache" "--rc-web-gui-no-open-browser" "--rc-user=XXXX" "--rc-pass=XXXX"]
2021/11/26 13:47:08 DEBUG : Current tag: v2.0.5, Release tag: v2.0.5
2021/11/26 13:47:08 NOTICE: Web GUI exists. Update skipped.
2021/11/26 13:47:08 NOTICE: Serving Web GUI
2021/11/26 13:47:08 INFO : Using --user XXXX --pass XXXX as authenticated user
2021/11/26 13:47:08 NOTICE: Serving remote control on http://[::]:5572/
2021/11/26 13:47:08 DEBUG : login_token "XXXX"
2021/11/26 13:47:08 NOTICE: Web GUI is not automatically opening browser. Navigate to http://XXXX:XXXX@[::]:5572/?login_token=XXXX to use.
2021/11/26 13:47:44 DEBUG : rc: "core/stats": with parameters map[]
2021/11/26 13:47:44 DEBUG : rc: "core/stats": reply map[bytes:0 checks:0 deletedDirs:0 deletes:0 elapsedTime:36.153259961 errors:0 eta:<nil> fatalError:false renames:0 retryError:false speed:0 totalBytes:0 totalChecks:0 totalTransfers:0 transferTime:0 transfers:0]: <nil>
2021/11/26 13:48:44 DEBUG : rc: "core/stats": with parameters map[]
2021/11/26 13:48:44 DEBUG : rc: "core/stats": reply map[bytes:0 checks:0 deletedDirs:0 deletes:0 elapsedTime:96.153769019 errors:0 eta:<nil> fatalError:false renames:0 retryError:false speed:0 totalBytes:0 totalChecks:0 totalTransfers:0 transferTime:0 transfers:0]: <nil>
2021/11/26 13:49:44 DEBUG : rc: "core/stats": with parameters map[]
2021/11/26 13:49:44 DEBUG : rc: "core/stats": reply map[bytes:0 checks:0 deletedDirs:0 deletes:0 elapsedTime:156.149964871 errors:0 eta:<nil> fatalError:false renames:0 retryError:false speed:0 totalBytes:0 totalChecks:0 totalTransfers:0 transferTime:0 transfers:0]: <nil>
2021/11/26 13:49:54 DEBUG : rc: "sync/sync": with parameters map[_async:true _config:map[log:map[File:/config/rclone/duplicati.log] main:map[LogLevel:INFO]] createEmptySrcDirs:true dstFs:gdrive:/backups/databases srcFs:/data/backups/databases]
2021/11/26 13:49:54 DEBUG : rc: "sync/sync": reply map[jobid:4]: <nil>
2021/11/26 13:49:54 DEBUG : Creating backend with remote "/data/backups/databases"
2021/11/26 13:49:54 DEBUG : Using config file from "/config/rclone/rclone.conf"
2021/11/26 13:49:54 DEBUG : Creating backend with remote "gdrive:/backups/databases"
2021/11/26 13:49:54 DEBUG : gdrive: Loaded invalid token from config file - ignoring
2021/11/26 13:49:54 DEBUG : Saving config "token" in section "gdrive" of the config file
2021/11/26 13:49:54 DEBUG : gdrive: Saved new token in config file
2021/11/26 13:49:55 DEBUG : fs cache: renaming cache item "gdrive:/backups/databases" to be canonical "gdrive:backups/databases"
2021/11/26 13:49:55 DEBUG : duplicati-20211121T020000Z.dlist.zip.aes: Size and modification time the same (differ by -847.562µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-20211122T020000Z.dlist.zip.aes: Size and modification time the same (differ by -638.231µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-20211121T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211122T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211120T020000Z.dlist.zip.aes: Size and modification time the same (differ by -806.643µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b4c782be9089449da856f76c4d4455d21.dblock.zip.aes: Size and modification time the same (differ by -655.488µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b4c782be9089449da856f76c4d4455d21.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-b2a522740a56c4d21b97ed36648511185.dblock.zip.aes: Size and modification time the same (differ by -847.427µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b20e8ef1f588045a2855c75c447fafa67.dblock.zip.aes: Size and modification time the same (differ by -593.772µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b585860f4971e4a99a789114fc3ec1337.dblock.zip.aes: Size and modification time the same (differ by -416.978µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-20211123T020000Z.dlist.zip.aes: Size and modification time the same (differ by -417.089µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b585860f4971e4a99a789114fc3ec1337.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-b20e8ef1f588045a2855c75c447fafa67.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-b7eb3c8a9e4514878b624b7de315b363e.dblock.zip.aes: Size and modification time the same (differ by -59.506µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b7eb3c8a9e4514878b624b7de315b363e.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-b8b469358715a4d8eb8d2df898b9f0ee7.dblock.zip.aes: Size and modification time the same (differ by -582.742µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-b8b469358715a4d8eb8d2df898b9f0ee7.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-bd95f362e88e246ccb2c3f7312b14827d.dblock.zip.aes: Size and modification time the same (differ by -46.332µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-bd95f362e88e246ccb2c3f7312b14827d.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-bdbb37581fcef4771a75bf339dcbf65bd.dblock.zip.aes: Size and modification time the same (differ by -5.107µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : Google drive root 'backups/databases': Waiting for checks to finish
2021/11/26 13:49:55 DEBUG : duplicati-be44582a8348c4ec38aefd21f558242c6.dblock.zip.aes: Size and modification time the same (differ by -806.508µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-20211123T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211126T020000Z.dlist.zip.aes: Size and modification time the same (differ by -582.875µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-be44582a8348c4ec38aefd21f558242c6.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-i16eeefb8b7a74576a17288c90af423b9.dindex.zip.aes: Size and modification time the same (differ by -806.581µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-i16eeefb8b7a74576a17288c90af423b9.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211126T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-i52a92a7cc8b9436d92ab6106eba18355.dindex.zip.aes: Size and modification time the same (differ by -59.587µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-i52a92a7cc8b9436d92ab6106eba18355.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-beb10f8246dde4e6ca7200af8460789d7.dblock.zip.aes: Size and modification time the same (differ by -638.097µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-i8fd4efd69016467b9e1e4c3bf767dd95.dindex.zip.aes: Size and modification time the same (differ by -582.818µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-i8fd4efd69016467b9e1e4c3bf767dd95.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-beb10f8246dde4e6ca7200af8460789d7.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-i76282620b38944459195dc803ef5b901.dindex.zip.aes: Size and modification time the same (differ by -847.494µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-bdbb37581fcef4771a75bf339dcbf65bd.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-i76282620b38944459195dc803ef5b901.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-ib456b4e61096415787848f2306281679.dindex.zip.aes: Size and modification time the same (differ by -593.845µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-ibf2ba4fb278c44ed9177ad2dcdeccd91.dindex.zip.aes: Size and modification time the same (differ by -46.407µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-ib456b4e61096415787848f2306281679.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-i99ba762dcab34040a25dd1d06a55dc80.dindex.zip.aes: Size and modification time the same (differ by -417.039µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-i99ba762dcab34040a25dd1d06a55dc80.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-iccf7397b48cd4154b6e1305e59554a8d.dindex.zip.aes: Size and modification time the same (differ by -655.558µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-iccf7397b48cd4154b6e1305e59554a8d.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-ie5dd147991934642b2a3ad19ac9eff2b.dindex.zip.aes: Size and modification time the same (differ by -638.181µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-ie5dd147991934642b2a3ad19ac9eff2b.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211124T020000Z.dlist.zip.aes: Size and modification time the same (differ by -59.657µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-20211124T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-ibe91882fa32b4143ad7777a883f8fcfc.dindex.zip.aes: Size and modification time the same (differ by -5.159µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-ibe91882fa32b4143ad7777a883f8fcfc.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-b2a522740a56c4d21b97ed36648511185.dblock.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-ibf2ba4fb278c44ed9177ad2dcdeccd91.dindex.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211120T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : duplicati-20211125T020000Z.dlist.zip.aes: Size and modification time the same (differ by -655.62µs, within tolerance 1ms)
2021/11/26 13:49:55 DEBUG : duplicati-20211125T020000Z.dlist.zip.aes: Unchanged skipping
2021/11/26 13:49:55 DEBUG : Google drive root 'backups/databases': Waiting for transfers to finish
2021/11/26 13:49:55 DEBUG : Waiting for deletions to finish
2021/11/26 13:49:55 INFO : There was nothing to transfer

```

---

<div class="post-metadata">

**Author:** ![Rourke](https://forum.rclone.org/user_avatar/forum.rclone.org/rourke/32/6260_2.png) [@Rourke](https://forum.rclone.org/u/Rourke)\
**Post date:** [November 26, 2021, 11:50am UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/2 "2021-11-26T11:50:53Z")

</div>

I tried to set it on a global level before sending out the above command, with this:

```auto
  log_payload='{"main":{"LogLevel":"DEBUG"},"log":{"File":"/test.log"}}}'
  log_output=$(curl -s \
    -H "Content-Type: application/json" \
    -X POST \
    -d "${log_payload}" \
    "http://${rclone_user}:${rclone_pass}@${rclone_host}:${rclone_port}/options/set")

```

I see both settings have changed, but no output in the log yet.

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [November 26, 2021, 11:58am UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/3 "2021-11-26T11:58:55Z")

</div>

Hard to know because you deleted the template so we have no idea, version, any log file to look at, any specifics on your setup.

---

<div class="post-metadata">

**Author:** ![Rourke](https://forum.rclone.org/user_avatar/forum.rclone.org/rourke/32/6260_2.png) [@Rourke](https://forum.rclone.org/u/Rourke)\
**Post date:** [November 26, 2021, 12:55pm UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/4 "2021-11-26T12:55:20Z")

</div>

Apologies. I was in a hurry and didn't carefully read. But no excuse. I updated my initial post.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [November 27, 2021, 3:34pm UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/5 "2021-11-27T15:34:36Z")

</div>

> [@Rourke](#):
>
> I'm sending rclone jobs from one container to the other through the rclone API. Communication between the containers is fine, but I want to set the log-level and log-file on a per request basis.

This looks as though it should work, but it doesn't yet, alas.

That is because every log statement in rclone would need a context added to it and I deemed it too much work for too little gain at the time. I might reconsider this at some point, but it would be a very invasive change threading context through just about everything!

Setting the log levels globally should definitely work though.

---

<div class="post-metadata">

**Author:** ![Rourke](https://forum.rclone.org/user_avatar/forum.rclone.org/rourke/32/6260_2.png) [@Rourke](https://forum.rclone.org/u/Rourke)\
**Post date:** [December 2, 2021, 11:13am UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/6 "2021-12-02T11:13:54Z")

</div>

Alright, thanks for the explanation.

> [@ncw](#):
>
> Setting the log levels globally should definitely work though.

With `options/set` I can set it globally right?

When I do a `options/get` I get the below output. From within the rclone container I can write to the `log` \> `File` (`/config/rclone/duplicati.log`), and I see the `main` \> `LogLevel` is set to INFO (`6`). I still only see the output in the docker container log output.

```auto
/data $ rclone rc options/get --rc-user=XXXX --rc-pass="XXXXXXXXXXXXXX"
{
        "dlna": {
                "FriendlyName": "",
                "ListenAddr": ":7879",
                "LogTrace": false
        },
        "filter": {
                "DeleteExcluded": false,
                "ExcludeFile": "",
                "ExcludeFrom": null,
                "ExcludeRule": null,
                "FilesFrom": null,
                "FilesFromRaw": null,
                "FilterFrom": null,
                "FilterRule": null,
                "IgnoreCase": false,
                "IncludeFrom": null,
                "IncludeRule": null,
                "MaxAge": 9223372036854776000,
                "MaxSize": -1,
                "MinAge": 9223372036854776000,
                "MinSize": -1
        },
        "ftp": {
                "BasicPass": "",
                "BasicUser": "anonymous",
                "ListenAddr": "localhost:2121",
                "PassivePorts": "30000-32000",
                "PublicIP": "",
                "TLSCert": "",
                "TLSKey": ""
        },
        "http": {
                "BaseURL": "",
                "BasicPass": "",
                "BasicUser": "",
                "ClientCA": "",
                "HtPasswd": "",
                "ListenAddr": "localhost:8080",
                "MaxHeaderBytes": 4096,
                "Realm": "rclone",
                "ServerReadTimeout": 3600000000000,
                "ServerWriteTimeout": 3600000000000,
                "SslCert": "",
                "SslKey": "",
                "Template": ""
        },
        "log": {
                "File": "/config/rclone/duplicati.log",
                "Format": "date,time",
                "LogSystemdSupport": false,
                "SyslogFacility": "DAEMON",
                "UseSyslog": false
        },
        "main": {
                "AskPassword": true,
                "AutoConfirm": false,
                "BackupDir": "",
                "BindAddr": "",
                "BufferSize": 16777216,
                "BwLimit": "",
                "BwLimitFile": "",
                "CaCert": "",
                "CheckFirst": false,
                "CheckSum": false,
                "Checkers": 8,
                "ClientCert": "",
                "ClientKey": "",
                "CompareDest": null,
                "ConnectTimeout": 60000000000,
                "Cookie": false,
                "CopyDest": null,
                "CutoffMode": 0,
                "DataRateUnit": "bytes",
                "DeleteMode": 3,
                "DisableFeatures": null,
                "DisableHTTP2": false,
                "DownloadHeaders": null,
                "DryRun": false,
                "Dump": 0,
                "ErrorOnNoTransfer": false,
                "ExpectContinueTimeout": 1000000000,
                "FsCacheExpireDuration": 300000000000,
                "FsCacheExpireInterval": 60000000000,
                "Headers": null,
                "HumanReadable": false,
                "IgnoreCaseSync": false,
                "IgnoreChecksum": false,
                "IgnoreErrors": false,
                "IgnoreExisting": false,
                "IgnoreSize": false,
                "IgnoreTimes": false,
                "Immutable": false,
                "InsecureSkipVerify": false,
                "Interactive": false,
                "KvLockTime": 1000000000,
                "LogLevel": 6,
                "LowLevelRetries": 10,
                "MaxBacklog": 10000,
                "MaxDelete": -1,
                "MaxDepth": -1,
                "MaxDuration": 0,
                "MaxStatsGroups": 1000,
                "MaxTransfer": -1,
                "ModifyWindow": 1,
                "MultiThreadCutoff": 262144000,
                "MultiThreadSet": false,
                "MultiThreadStreams": 4,
                "NoCheckDest": false,
                "NoConsole": false,
                "NoGzip": false,
                "NoTraverse": false,
                "NoUnicodeNormalization": false,
                "NoUpdateModTime": false,
                "OrderBy": "",
                "PasswordCommand": null,
                "Progress": false,
                "ProgressTerminalTitle": false,
                "RefreshTimes": false,
                "SizeOnly": false,
                "StatsFileNameLength": 45,
                "StatsLogLevel": 6,
                "StatsOneLine": false,
                "StatsOneLineDate": false,
                "StatsOneLineDateFormat": "",
                "StreamingUploadCutoff": 102400,
                "Suffix": "",
                "SuffixKeepExtension": false,
                "TPSLimit": 0,
                "TPSLimitBurst": 1,
                "Timeout": 300000000000,
                "TrackRenames": false,
                "TrackRenamesStrategy": "hash",
                "TrafficClass": 0,
                "Transfers": 4,
                "UpdateOlder": false,
                "UploadHeaders": null,
                "UseJSONLog": false,
                "UseListR": false,
                "UseMmap": false,
                "UseServerModTime": false,
                "UserAgent": "rclone/v1.57.0"
        },
        "mount": {
                "AllowNonEmpty": false,
                "AllowOther": false,
                "AllowRoot": false,
                "AsyncRead": true,
                "AttrTimeout": 1000000000,
                "Daemon": false,
                "DaemonTimeout": 0,
                "DaemonWait": 60000000000,
                "DebugFUSE": false,
                "DefaultPermissions": false,
                "ExtraFlags": [],
                "ExtraOptions": [],
                "MaxReadAhead": 131072,
                "NetworkMode": false,
                "NoAppleDouble": true,
                "NoAppleXattr": false,
                "VolumeName": "",
                "WritebackCache": false
        },
        "rc": {
                "AccessControlAllowOrigin": "",
                "EnableMetrics": false,
                "Enabled": true,
                "Files": "",
                "HTTPOptions": {
                        "BaseURL": "",
                        "BasicPass": "XXXXXXXXXXXXXXXXXXXXX",
                        "BasicUser": "XXXX",
                        "ClientCA": "",
                        "HtPasswd": "",
                        "ListenAddr": ":5572",
                        "MaxHeaderBytes": 4096,
                        "Realm": "rclone",
                        "ServerReadTimeout": 3600000000000,
                        "ServerWriteTimeout": 3600000000000,
                        "SslCert": "",
                        "SslKey": "",
                        "Template": ""
                },
                "JobExpireDuration": 60000000000,
                "JobExpireInterval": 10000000000,
                "NoAuth": false,
                "Serve": true,
                "WebGUIFetchURL": "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest",
                "WebGUIForceUpdate": false,
                "WebGUINoOpenBrowser": true,
                "WebGUIUpdate": false,
                "WebUI": true
        },
        "rc-http": {
                "BaseURL": "",
                "BasicPass": "XXXXXXXXXXXXXXXXXXXXX",
                "BasicUser": "XXXX",
                "ClientCA": "",
                "HtPasswd": "",
                "ListenAddr": ":5572",
                "MaxHeaderBytes": 4096,
                "Realm": "rclone",
                "ServerReadTimeout": 3600000000000,
                "ServerWriteTimeout": 3600000000000,
                "SslCert": "",
                "SslKey": "",
                "Template": ""
        },
        "sftp": {
                "AuthorizedKeys": "~/.ssh/authorized_keys",
                "HostKeys": null,
                "ListenAddr": "localhost:2022",
                "NoAuth": false,
                "Pass": "",
                "Stdio": false,
                "User": ""
        },
        "vfs": {
                "CacheMaxAge": 3600000000000,
                "CacheMaxSize": -1,
                "CacheMode": 0,
                "CachePollInterval": 60000000000,
                "CaseInsensitive": false,
                "ChunkSize": 134217728,
                "ChunkSizeLimit": -1,
                "DirCacheTime": 300000000000,
                "DirPerms": 511,
                "FilePerms": 438,
                "GID": 100,
                "NoChecksum": false,
                "NoModTime": false,
                "NoSeek": false,
                "PollInterval": 60000000000,
                "ReadAhead": 0,
                "ReadOnly": false,
                "ReadWait": 20000000,
                "UID": 1000,
                "Umask": 18,
                "UsedIsSize": false,
                "WriteBack": 5000000000,
                "WriteWait": 1000000000
        }
}

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [December 2, 2021, 3:27pm UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/7 "2021-12-02T15:27:39Z")

</div>

> [@Rourke](#):
>
> With `options/set` I can set it globally right?

Yes

```auto
$ rclone rc options/get | grep LogLevel
		"LogLevel": 5,
		"StatsLogLevel": 6,
$ rclone rc options/set --json '{"main":{"LogLevel":"DEBUG"}}'
{}
$ rclone rc options/get | grep LogLevel
		"LogLevel": 7,
		"StatsLogLevel": 6,
ncw@dogger:~$ 

```

Turned the debug on in my `rclone rcd`

```auto
$ rclone rcd --rc-no-auth
2021/12/02 15:24:22 NOTICE: Serving remote control on http://localhost:5572/
2021/12/02 15:25:09 DEBUG : rc: "options/set": reply map[]: <nil>
2021/12/02 15:25:11 DEBUG : rc: "options/get": with parameters map[]
2021/12/02 15:25:11 DEBUG : rc: "options/get": reply map[dlna:0xc000590c50 filter:0x365dbe0 ftp:0x35a4880 http:0xc000590ca8 log:0x35a1da0 main:0xc000188000 mount:0x365d8a0 rc:0x365de00 rc-http:0xc000590d20 sftp:0xc000590ca0 vfs:0x368f5a0]: <nil>

```

> [@Rourke](#):
>
> I still only see the output in the docker container log output.

That is where the log will go. Where were you hoping it would go?

---

<div class="post-metadata">

**Author:** ![Rourke](https://forum.rclone.org/user_avatar/forum.rclone.org/rourke/32/6260_2.png) [@Rourke](https://forum.rclone.org/u/Rourke)\
**Post date:** [December 2, 2021, 4:23pm UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/8 "2021-12-02T16:23:20Z")

</div>

> [@ncw](#):
>
> That is where the log will go. Where were you hoping it would go?

To my own log file `/config/rclone/duplicati.log` mounted in the rclone container. I'm probably not understanding logging correctly, but I assumed changing the log.File setting like `'{"log":{"File":"/config/rclone/duplicati.log"}}'` would write the log output to that specific file instead of (or alongside) the default docker log.

Perhaps it also helps if I elaborate on what I'm making. I will create different bash scripts that each start a separate sync job towards rclone. Each bash script will log to its own log file. I would like to have the rclone log output written to those log files as well, so I would for example end up with a combined log file like this:

```log
Start syncing backup files to gdrive
books/duplicati-20211202T020047Z.dlist.zip.aes: Copied (new)
documents/duplicati-20211202T020041Z.dlist.zip.aes: Copied (new)
books/duplicati-b62eb4b661f7e40dfae6396326c6a4176.dblock.zip.aes: Copied (new)
books/duplicati-if74e106623e04a31bb5c022c5f6638cd.dindex.zip.aes: Copied (new)
documents/duplicati-bc8da7739adca416eb08efdd2b426d7b4.dblock.zip.aes: Copied (new)
documents/duplicati-ic91eca74e26e4a58bfac7fa70dec70fb.dindex.zip.aes: Copied (new)
docker-volumes/duplicati-20211202T020026Z.dlist.zip.aes: Copied (new)
docker-volumes/duplicati-i652e78bc1c324a0881305a4625074de4.dindex.zip.aes: Copied (new)
databases/duplicati-20211202T020000Z.dlist.zip.aes: Copied (new)
databases/duplicati-i1b8e04950349447db76e69c10cf778a2.dindex.zip.aes: Copied (new)
databases/duplicati-b971d834801224a40a2b7102ec22c1a3b.dblock.zip.aes: Copied (new)
docker-binds/duplicati-ia15782e11c7944859af52183518e96f6.dindex.zip.aes: Copied (new)
docker-binds/duplicati-20211202T020000Z.dlist.zip.aes: Copied (new)
docker-volumes/duplicati-bc9af3938046946339d0c9f0769764bfe.dblock.zip.aes: Copied (new)
docker-binds/duplicati-b3312effec4014a4496cb8c860908dcec.dblock.zip.aes: Copied (new)
docker-volumes/duplicati-20211201T020128Z.dlist.zip.aes: Deleted
docker-binds/duplicati-20211201T020000Z.dlist.zip.aes: Deleted
books/duplicati-20211125T020014Z.dlist.zip.aes: Deleted
documents/duplicati-20211125T020008Z.dlist.zip.aes: Deleted
docker-binds/duplicati-20211125T020000Z.dlist.zip.aes: Deleted
docker-volumes/duplicati-20211125T020005Z.dlist.zip.aes: Deleted
books/duplicati-20211201T020205Z.dlist.zip.aes: Deleted
documents/duplicati-20211201T020158Z.dlist.zip.aes: Deleted
databases/duplicati-20211124T020000Z.dlist.zip.aes: Deleted
errors=0, checks=2287, deletes=9, renames=0, transfers=15
Syncing to gdrive is done

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [December 6, 2021, 4:42pm UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/9 "2021-12-06T16:42:34Z")

</div>

> [@Rourke](#):
>
> > [@ncw](#):
> >
> > That is where the log will go. Where were you hoping it would go?
> 
> To my own log file `/config/rclone/duplicati.log` mounted in the rclone container. I'm probably not understanding logging correctly, but I assumed changing the log.File setting like `'{"log":{"File":"/config/rclone/duplicati.log"}}'` would write the log output to that specific file instead of (or alongside) the default docker log.

Sorry, I missed that you set it in the rc call.

I don't think setting log file works via the RC right now. It probably should...

When the logging config gets registered it needs to specify a callback to do stuff if the parameters are changed with `rc.AddOptionReload`...

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [January 5, 2022, 4:43pm UTC](https://forum.rclone.org/t/set-log-settings-per-api-call/27723/10 "2022-01-05T16:43:26Z")

</div>

Closed on January 5, 2022, 4:43pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
