aws / aws/amazon-cloudwatch-agent

Cloudwatch agent keep files open

Open
#252 9 comments 0 reactions 0 assignees View on GitHub
bug os/windows
Dominant language
Go
Stars
550
Forks
271
Avg merge
1d 21h
Merged PRs (30d)
13

Description

My company started using Cloudwatch Agent in an attempt to "shadow" an application log and send it over to Cloudwatch Logs.
It does work fine *until* my application eventually restarts (and thus has to FileClose/FileOpen the log file again).
After the restart, any further attempt to write/append to the log file results in Win Error IO 32 "File is opened by another application".

OS is Windows Server 2019
Application language is Autohotkey and Python.

It is double-checked that cwagent is the application "holding" the log file opened. Just by stopping/restarting the service it goes back to work.

Timeline:

1- Application create/appends to log file
2- cwagent is started
3- Application keeps writing to log file ok
4- Application keeps writing to log file ok
5- Logs go to Cloudwatch logs just ok
-- until here it works fine
6- Our application restarts
7- Any further attempt to write fails because file is currently opened/in use by cwagent
-- fail
8- We stop/restart the cwagent
9- Application is once again able to do logging
-- works fine until the next restart

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.