Skip to content

feat(windows-agent): Add Windows Event Logger support#764

Draft
ashuntu wants to merge 3 commits intomainfrom
event-log
Draft

feat(windows-agent): Add Windows Event Logger support#764
ashuntu wants to merge 3 commits intomainfrom
event-log

Conversation

@ashuntu
Copy link
Copy Markdown
Collaborator

@ashuntu ashuntu commented May 9, 2024

This changes the default logging method from file logging to using the Windows Event Logger. File logging is still available through the use of the new --file-log-enabled flag (and its accompanying --event-log-enabled flag, which is enabled by default).

You can view logs on Windows 11 by searching for the Event Viewer application and creating a Custom View for all event levels of the "Application" logs.

The eventlog support from Golang doesn't seem to include a debug function, so all debug logs are rerouted as info-level logs in the event viewer. In addition, there are event IDs which essentially go unused in this use case (0) as I believe they're mostly OS-specific event types and would be hard to utilize through the logging methods we're currently using.


UDENG-2323

@ashuntu ashuntu self-assigned this May 9, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented May 9, 2024

Codecov Report

❌ Patch coverage is 43.85965% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.38%. Comparing base (56e1917) to head (0a69561).
⚠️ Report is 1912 commits behind head on main.

Files with missing lines Patch % Lines
windows-agent/cmd/ubuntu-pro-agent/agent/agent.go 42.22% 23 Missing and 3 partials ⚠️
windows-agent/cmd/ubuntu-pro-agent/agent/config.go 50.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #764      +/-   ##
==========================================
- Coverage   89.11%   87.38%   -1.73%     
==========================================
  Files         100      100              
  Lines        5519     6530    +1011     
==========================================
+ Hits         4918     5706     +788     
- Misses        426      642     +216     
- Partials      175      182       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The writer didn't need to be exported, so this makes it private.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant