Implement log rotation for tray app

This commit is contained in:
Daniel Hiltgen
2024-06-15 16:30:37 -07:00
parent 96624aa412
commit 9d8a4988e8
6 changed files with 86 additions and 9 deletions

View File

@@ -54,7 +54,7 @@ func start(ctx context.Context, command string) (*exec.Cmd, error) {
return nil, fmt.Errorf("failed to spawn server stderr pipe: %w", err)
}
// TODO - rotation
rotateLogs(ServerLogFile)
logFile, err := os.OpenFile(ServerLogFile, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0755)
if err != nil {
return nil, fmt.Errorf("failed to create server log: %w", err)