Skip to content
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

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ashuntu
Copy link
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
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 43.85965% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 87.38%. Comparing base (56e1917) to head (0a69561).
Report is 1 commits behind head on main.

Files 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.

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