-
Notifications
You must be signed in to change notification settings - Fork 266
added accountId to each log #3389
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
added accountId to each log #3389
Conversation
|
|
||
| public void error(String errorMessage, Object... vars) { | ||
| logger.error(errorMessage, vars); | ||
| String accountId = Context.accountId.get() != null ? Context.accountId.get().toString() : "NA"; |
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.
create a common function
getFormattedMessage use it everyhwere
| if (Context.accountId.get() != null) { | ||
| err = String.format("%s\naccountId: %d", err, Context.accountId.get()); | ||
| } |
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.
we don't need this? formattedMessage will anyways add the accountID
| */ | ||
| private String getFormattedMessage(String message) { | ||
| String accountId = Context.accountId.get() != null ? Context.accountId.get().toString() : "NA"; | ||
| return "accountId: " + accountId + ", " + message; |
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.
For each log line we need to make it parseable by code/regex. For that we must have specfic format. Let's keep this for now.
`return "accountId: " + accountId + " message: " + message;
b113330
into
akto-api-security:feature/fluentd-logging
No description provided.