-
Notifications
You must be signed in to change notification settings - Fork 69
Suppress unnecessary error log for ERROR_NOT_SUPPORTED cases #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if (GetLastError() != ERROR_NOT_SUPPORTED) | ||
| { | ||
| logWriter.TraceError( | ||
| Utility::FormatString( | ||
| L"Error in log file monitor. Failed to open file %ws. Error = %d", | ||
| fileName.c_str(), | ||
| GetLastError() | ||
| ).c_str() | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bobsira I think similar workaround is needed here
windows-container-tools/LogMonitor/src/LogMonitor/LogFileMonitor.cpp
Lines 1082 to 1088 in 09983f6
| logWriter.TraceError( | |
| Utility::FormatString( | |
| L"Error in log file monitor. Failed to query file ID. File: %ws. Error: %d", | |
| fullLongPath.c_str(), | |
| status | |
| ).c_str() | |
| ); |
I'm testing your LogMonitor.exe build you linked in #214 (comment) and
The waitInSeconds: 10 does not seem to help delay the files query in this particular case.
My LogMonitorConfig.json is this
{
"LogConfig": {
"sources": [
{
"includeSubdirectories": false,
"filter": "*.log",
"directory": "C:\\Logs",
"waitInSeconds": 10,
"type": "File",
"includeFileNames": true
}
]
}
}The fix for ordering of the waitInSeconds seem to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mloskot please confirm if the issue still exists in this binary -> https://minikubevhdimagebuider.blob.core.windows.net/versions/LogMonitor.exe
It has the change you've suggested. if it's there we can move this fix to a different PR and let this handle the parser fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bobsira Hmm, I've just tested LogMonitor.exe from that URL
Invoke-WebRequest -Uri 'https://minikubevhdimagebuider.blob.core.windows.net/versions/LogMonitor.exe' -OutFile C:/LogMonitor.exe -UseBasicParsing
and this version is reported inside the container - am I using the right custom ad-hoc build of yours?
but I can't see any difference
Here is my config inside the container
and logs location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, strange that should be the binary with the change. I'll go ahead and split the PR for now. I have a feeling this issue might be coming from another place in the code as well so let's have it addressed in a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Let's take baby steps. The overall direction seems fine though 😊
|
@bobsira Any update on this? |
|
@bobsira @CharityKathure @profnandaa Any chance to get this merged and released? |
@mloskot Charity and Nandaa are not working on Log Monitor anymore. I'll revisit this issue this week! |
|
@mloskot I'll merge this and we will have it in the next release. |
This pull request introduces targeted improvements to error logging in the
LogFileMonitorcomponent. The main change is the suppression of log messages for the benignERROR_NOT_SUPPORTEDerror, which helps reduce unnecessary log noise while still capturing actionable errors.Error logging improvements:
ERROR_NOT_SUPPORTEDwhen failing to open log files inInitializeDirectoryChangeEventsQueue()to avoid log pollution from benign errors. [1] [2]ERROR_NOT_SUPPORTEDwhen failing to query file ID inLogFileAddEventHandler()for the same reason, ensuring only actionable errors are logged.