Skip to content

serve logging should use unscaped URIs #7370

Closed

Description

@pyhedgehog

The associated forum post URL from https://forum.rclone.org

N/A

What is your current rclone version (output from rclone version)?

rclone v1.63.1

What problem are you are trying to solve?

Logging of rclone serve dlna looks very misleading if there are non-latin filenames:

2023/10/14 03:56:31 INFO  : /r/%D0%91%D0%B0%D1%80%D0%B4%D1%8B/%D0%90%D0%B4%D1%80%D0%B8%D0%B0%D0%BD%20%D0%B8%20%D0%90%D0%BB%D0%B5%D0
%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80/2009%20Para%20Bellum/08%20%D0%9F%D0%B0%D0%B2%D0%B5%D0%BB%D0%B5%D1%86%D0%BA%D0%B8%D0%B9%20%D0%B2%D
0%BE%D0%BA%D0%B7%D0%B0%D0%BB%20%28%D1%81%D1%82%D0%B8%D1%85%D0%B8%29.mp3: 192.168.1.77:46742 GET 200

It will be much better to see something like this:

2023/10/14 03:56:31 INFO  : /r/Барды/Адриан и Александр/2009 Para Bellum/08 Павелецкий вокзал (стихи).mp3: 192.168.1.77:46742 GET 200

How do you think rclone should be changed to solve that?

I'm not sure that this should be forced for all cases, but at least we should have such option (with default to human-readable form).
So, I think that here:

fs.LogPrintf(level, lrw.request.URL, "%s %s %d %s %s",
lrw.request.RemoteAddr, lrw.request.Method, code,
lrw.request.Header.Get("SOAPACTION"), err)

lrw.request.URL should be changed to lrw.request.URL.Path with option (something like --dlna-log-full-url) to revert.

Activity

  1. ncw commented on Oct 14, 2023

    @ncw
    Member

    Yes this looks like a sensible change. Do you want to send a pull request?

  2. ncw commented on Oct 14, 2023

    @ncw
    Member

    I don't think there is a need for a flag.

  3. pyhedgehog commented on Oct 16, 2023

    @pyhedgehog
    ContributorAuthor

    I'm not golang pro, so I can only send patch without flag.
    There are two situations where flag can be important:

    1. To debug correct decoding (i.e. /%2f/ will look like ///).
    2. To debug query-string (which is not included in URL.Path).
  4. ncw commented on Sep 21, 2026

    @ncw
    Member

    I've merged @hsdfat this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.76

  5. added a commit that references this issue on Sep 21, 2026
    556940e
  6. added a commit that references this issue on Oct 6, 2026
    9b0d438
  7. added a commit that references this issue on Oct 8, 2026
    06387f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions