1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hello.
What error occurs when trying to write logs from an application when the CloudWatch agent has a lock on the log file?
Contenus pertinents
- demandé il y a un an
- demandé il y a 14 jours
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 5 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
The error says that the Powershell script cannot write to the log file because other processes handling the log file. I've checked in "Process Explorer" and that was Cloud Watch agent... Best Regards, Chris
How does the PowerShell script write to the log file? I would like to reproduce this in my environment.
Hello Riku, Thank you in advance ;)
Please find below part of the PS code:
$CurrDate = (Get-Date).ToString("yyyyMMdd") $logFile = "C:\Support\scripts\aws-test-rds-connection\logs\test-rds-connection-" + $CurrDate + ".txt"
function Write-LogFile { param ([string]$logstring)
}
Write-LogFile "Starting script"