-
Notifications
You must be signed in to change notification settings - Fork 77
Audit log in failed connection cases #1281
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
Open
ryanwixon-emerson
wants to merge
20
commits into
ni:main
Choose a base branch
from
ryanwixon-emerson:failureLogging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f55be57
Log in successful connection cases
ryanwixon-emerson 6073f3b
Match source name from installer
ryanwixon-emerson c85a85b
Improve log message formatting and ditch set approach
ryanwixon-emerson e33fe95
Update README to document registry key requirement
ryanwixon-emerson 4f60dcd
Log on failure (not finished)
ryanwixon-emerson 1d2ce26
Review fixes
ryanwixon-emerson 635f5d7
Fix typo in README
ryanwixon-emerson 422f414
More review fixes (needs test)
ryanwixon-emerson cf4fd28
Documentation update for review
ryanwixon-emerson 3c77e46
Remove severity filter
ryanwixon-emerson 05ea291
Merge branch 'successLogging' of https://github.com/ryanwixon-emerson…
ryanwixon-emerson 59ee8ac
Fix typo from merge
ryanwixon-emerson 8068587
RAII wrapper for sink
ryanwixon-emerson 06656d5
Merge branch 'main' of https://github.com/ni/grpc-device into failure…
ryanwixon-emerson 09efcb4
Trim comment
ryanwixon-emerson ecf700d
Rearrange log initialization
ryanwixon-emerson 1ea4701
Empty commit, retry Windows build
ryanwixon-emerson 12e04a4
Empty commit, retry Windows build again
ryanwixon-emerson 8d39d5a
Addess review comments
ryanwixon-emerson 89e8bfc
Tweak sink source name
ryanwixon-emerson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,9 +53,9 @@ namespace { | |
| std::shared_ptr<spdlog::logger> get_event_log_logger() | ||
| { | ||
| static std::shared_ptr<spdlog::logger> audit_logger = []() { | ||
| auto sink = std::make_shared<spdlog::sinks::win_eventlog_sink_mt>("ni-grpc-device-server"); | ||
| auto sink = std::make_shared<spdlog::sinks::win_eventlog_sink_mt>("ni-grpc-device"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding in a quick unrelated change to this PR as I'm going to be changing the Windows Event Log source name to prevent the logs from being redundant. Today they are prefixed with "[ni-grpc-device-server][Server]". |
||
| auto logger = std::make_shared<spdlog::logger>("Server", sink); | ||
| logger->set_pattern("[ni-grpc-device-server][%n] %v"); | ||
| logger->set_pattern("[ni-grpc-device][%n] %v"); | ||
| return logger; | ||
| }(); | ||
| return audit_logger; | ||
|
|
@@ -100,7 +100,7 @@ void log_to_audit_source(Level level, const char* fmt, ...) | |
| } | ||
| #else | ||
| // We're manually prefixing audit logs in the Windows spdlog path, so manually add it here on the Linux path before sending it over to syslog. | ||
| const std::string message = "[ni-grpc-device-server][Server] " + std::string(fmt); | ||
| const std::string message = "[ni-grpc-device][Server] " + std::string(fmt); | ||
|
|
||
| va_list args; | ||
| va_start(args, fmt); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.