Chaning directories for logs and state files#7868
Chaning directories for logs and state files#7868brainrom wants to merge 5 commits intonextcloud:masterfrom
Conversation
Signed-off-by: Ilya Chelyadin <ilya77105@gmail.com>
Do you have access to Mac and/or Windows to check it? |
I can try build and check on Windows, but have absolutely no idea how to build and check on Mac.
What kind of testing? |
On Windows it would already help.
Sorry, I mean tests. Unit/code tests. |
Ok, then I'll manually test it on Windows.
Nextcloud currently don't have tests for similar things, not configs, nor migration. What exactly should I test? I can make test for |
|
Sorry I didn't reply before...
That makes sense.
You should check if there is a file present before migrating. That is what we do with the config file nextcloud.cfg. |
Signed-off-by: Ilya Chelyadin <ilya77105@gmail.com>
Signed-off-by: Ilya Chelyadin <ilya77105@gmail.com>
|
Now new file isn't overwritten if already exists. Added test for |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
I checked log generation on Linux, it records to |
| QString ConfigFile::logDir() const | ||
| { | ||
| const auto defaultLogDir = QString(configPath() + QStringLiteral("/logs")); | ||
| const auto defaultLogDir = QString(QStandardPaths::writableLocation(QStandardPaths::StateLocation) + QStringLiteral("/logs")); |
There was a problem hiding this comment.
before we change the log location, existing log files should be migrated to the new place
otherwise people may loose logs that may be important for them
There was a problem hiding this comment.
Is Application::setupLogging() is the good place for log migration routine? Looks like it's entry point for logDir() usage.
Fix for #3406 and #7654.
And cookie jar now also stores in
StateLocation, because it's app state and not configuration. Added corresponding migration function.Shouldn't negatively affect Windows and Mac OS, because
StateLocationon these platforms are subdirectories ofAppConfigLocation.From Qt doc:
"~/Library/Preferences/<APPNAME>""C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>""~/Library/Preferences/<APPNAME>/State""C:/Users/<USER>/AppData/Local/<APPNAME>/State", "C:/ProgramData/<APPNAME>/State"