Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs are saved in XDG_CONFIG_HOME rather than XDG_STATE_HOME #3406

Open
Toorero opened this issue Jun 5, 2021 · 5 comments
Open

Logs are saved in XDG_CONFIG_HOME rather than XDG_STATE_HOME #3406

Toorero opened this issue Jun 5, 2021 · 5 comments

Comments

@Toorero
Copy link

Toorero commented Jun 5, 2021

Expected behaviour

Logs should be saved (as stated by freedesktop) in the XDG_STATE_HOME.
A log is clearly not a "user-specific configuration" and logs are explicitly featured as an example of data that should be stored in XDG_STATE_HOME

Actual behaviour

Logs are stored in the XDG_CONFIG_HOME instead in the Nextcloud folder instead.

Steps to reproduce

Just use the client and let it produce logs.

Client configuration

Client version: 3.2.2git

Operating system: Archlinux

OS language: German

Qt version used by client package (Linux only, see also Settings dialog): 5.15.2+kde+r196-1

Client package (From Nextcloud or distro) (Linux only): 3.2.2-1

Installation path of client: /usr/share/nextcloud

@Toorero Toorero added the bug label Jun 5, 2021
@FlexW FlexW added confirmed bug approved by the team os: 🐧 Linux labels Jun 11, 2021
@franga2000
Copy link

I'd like to take a crack at implementing this when I get the time, so here's a few preemptive questions for the maintainers:

  1. Should this also be done for Windows? (logging moved to QStandardPaths::AppLocalDataLocation == ~\AppData\Local\ instead of Roaming)
  2. Since there isn't a QStandardPaths entry for XDG_STATE_HOME (the spec is quite new) and most environments don't "implement" it yet (neither the variable nor the dir itself exist), would it make more sense to use the AppLocalDataLocation (~/.local/share/) on Linux as well?
  3. Changing defaultLogDir should be sufficient, right?

@mgallien
Copy link
Collaborator

Thanks for your proposition of help
Sorry for the long time with no reply

I'd like to take a crack at implementing this when I get the time, so here's a few preemptive questions for the maintainers:

1. Should this also be done for Windows? (logging moved to `QStandardPaths::AppLocalDataLocation` == `~\AppData\Local\` instead of `Roaming`)

I would say yes

2. Since there isn't a `QStandardPaths` entry for `XDG_STATE_HOME` (the spec is quite new) and most environments don't "implement" it yet (neither the variable nor the dir itself exist), would it make more sense to use the `AppLocalDataLocation` (`~/.local/share/`) on Linux as well?

again yes especially because I do not think many software already use ~/.local/state (I only see files from pipiwire on my system)

3. _Changing [defaultLogDir](https://github.com/nextcloud/desktop/blob/ca4b4cde61484570ecd7e1cb63e37880e35a5fbf/src/libsync/configfile.cpp#L954) should be sufficient, right?_

You should also test that creating a debug archive for example still work as intended

@mgallien
Copy link
Collaborator

franga2000 added a commit to franga2000/desktop that referenced this issue Oct 4, 2021
franga2000 added a commit to franga2000/desktop that referenced this issue Oct 4, 2021
@joshtrichards joshtrichards changed the title Logs are saved in XDG_CONFIG_HOME Logs are saved in XDG_CONFIG_HOME rather than XDG_STATE_HOME Aug 14, 2024
@brainrom
Copy link

brainrom commented Oct 9, 2024

Did some research about paths in Nextcloud desktop client. Files, which worth attention:
src/gui/accountmanager.cpp - migration of "very old" configs
src/gui/application.cpp - migration of old configs
src/gui/syncrunfilelog.cpp - writes "nextcloud_sync.log" to QStandardPaths::AppDataLocation, possibly for #6201
src/libsync/account.cpp - creates cookies0.db file in QStandardPaths::AppConfigLocation applicable for #5208
src/libsync/configfile.cpp - sets confDir, ConfigFile::configPath() is used as main path for logs, etc.

In fact, only syncrunfilelog.cpp, account.cpp, configfile.cpp needs changes. This allow to align client with XDG. But what should be done for Mac OS and Windows? Keep current behavior or something else?
This solution is enough? #6201 (comment)

@Thaodan
Copy link
Contributor

Thaodan commented Oct 9, 2024 via email

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

No branches or pull requests

7 participants