Skip to content

Commit

Permalink
Merge pull request #6049 from nextcloud/backport/6012/stable-3.9
Browse files Browse the repository at this point in the history
[stable-3.9] Use a standardised locale to create log file filenames
  • Loading branch information
claucambra authored Sep 13, 2023
2 parents c6bce57 + 9bce16e commit 14cdd08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libsync/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,9 @@ void Logger::enterNextLogFileNoLock()
}

// Tentative new log name, will be adjusted if one like this already exists
QDateTime now = QDateTime::currentDateTime();
QString newLogName = now.toString("yyyyMMdd_HHmm") + "_nextcloud.log";
const auto now = QDateTime::currentDateTime();
const auto cLocale = QLocale::c(); // Some system locales generate strings that are incompatible with filesystem
QString newLogName = cLocale.toString(now, QStringLiteral("yyyyMMdd_HHmm")) + QStringLiteral("_nextcloud.log");

// Expire old log files and deal with conflicts
QStringList files = dir.entryList(QStringList("*owncloud.log.*"), QDir::Files, QDir::Name) +
Expand Down

0 comments on commit 14cdd08

Please sign in to comment.