Skip to content

Conversation

@harshithb3304
Copy link
Contributor

No description provided.


public void error(String errorMessage, Object... vars) {
logger.error(errorMessage, vars);
String accountId = Context.accountId.get() != null ? Context.accountId.get().toString() : "NA";
Copy link
Contributor

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

Comment on lines 160 to 162
if (Context.accountId.get() != null) {
err = String.format("%s\naccountId: %d", err, Context.accountId.get());
}
Copy link
Contributor

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;
Copy link
Contributor

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;

@gauravakto gauravakto changed the base branch from master to feature/fluentd-logging October 21, 2025 16:31
@gauravakto gauravakto merged commit b113330 into akto-api-security:feature/fluentd-logging Oct 21, 2025
1 check passed
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.

2 participants