Skip to content

Commit

Permalink
Merge pull request #68 from xvpn/PIA-1525-rotate-logs
Browse files Browse the repository at this point in the history
PIA-1525 Rotate logs
  • Loading branch information
kp-john-mair committed Mar 18, 2024
2 parents 33511a5 + f3e5444 commit c1a311e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ProxyExtension/Utilities/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ class Logger: LoggerProtocol {
let fileURL = URL(fileURLWithPath: self.logFile).absoluteURL

do {
let file = try FileLogger("com.privateinternetaccess.vpn.splittunnel.systemextension.logfile",
// Rotate logs after 500KB
let rotationConfig = RotationConfig(suffixExtension: .numbering,
maxFileSize: 500 * 1024, // 500KB is more than enough to diagnose any issues
maxArchivedFilesCount: 1)

let file = try FileRotationLogger("com.privateinternetaccess.vpn.splittunnel.systemextension.logfile",
logLevel: logLevelFromString(self.logLevel),
fileURL: fileURL,
filePermission: "777")
filePermission: "644",
rotationConfig: rotationConfig)
// Add the file logger
newPimpl.add(file)
}
Expand Down

0 comments on commit c1a311e

Please sign in to comment.