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

Write logs to local, not config dir #3868

Closed

Conversation

franga2000
Copy link

As discussed in #3406

Tested:

  • Platforms:
    • Linux
    • Windows
    • Mac OS
  • Features:
    • Dir structure and files created and written to as normal
    • Old logs are gzipped correctly
    • Creating a debug archive still includes log files

@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-3868-a09a4bf3333e6c29b52ff824b3b51f2ad34813fe-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@FlexW
Copy link

FlexW commented Oct 4, 2021

Cool, thank you :) will you be able to test it on Windows and macOS aswell?

@franga2000
Copy link
Author

franga2000 commented Oct 4, 2021

Yes, but I'm still setting up toolchains on both. Should have results in a few hrs

EDIT: yeah, that was optimistic, some things came up... 😅

@FlexW FlexW marked this pull request as draft October 4, 2021 13:32
@FlexW
Copy link

FlexW commented Oct 4, 2021

OK, I marked it as a draft pr. Feel free to request a review from me, @mgallien, @allexzander and @camilasan if it's ready, and mark it then as ready for review.

@@ -951,7 +951,7 @@ void ConfigFile::setAutomaticLogDir(bool enabled)

QString ConfigFile::logDir() const
{
const auto defaultLogDir = QString(configPath() + QStringLiteral("/logs"));
const auto defaultLogDir = QString(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/logs"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franga2000 I'd say, you need to change the corresponding part in QString ConfigFile::configPath() const if you want to only affect Linux. There is certain logic in QString ConfigFile::configPath() const that gets executed for Windows. Better try not to change the behavior.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Affecting other platforms was intentional, as discussed here: #3406 (comment).

As far as I can tell, configPath() only handles Windows differently because QStandardPaths::AppConfigLocation somewhat strangely resolves to AppData\Local. But AppLocalDataLocation resolves "reasonably" on Windows (according to the conventions I know). The rest of the login in the function moves config files from a legacy location, which doesn't interfere with this change either.

Given that, do you still prefer I leave Windows as it was before (logs alongside configs in AppData\Roaming)?

@franga2000
Copy link
Author

I haven't been able to build this to test on Windows or macOS as I only have VMs of them and everything takes ages to install. Any chance someone with a working build environment could give this a quick test (or at least compile and send it to me)?

@Rello
Copy link
Contributor

Rello commented Dec 3, 2024

Hello,

Thank you for your contribution to the Desktop Client with this pull request.
We are closing this request as it is outdated, no longer relevant (e.g., due to Qt 6), or does not align with the current roadmap.

We truly value your support and hope to see more contributions from you in the future!

Best regards,
Nextcloud Desktop Team

@Rello Rello closed this Dec 3, 2024
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.

5 participants