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

Add the possibility to process or transform the message #164

Open
fapena-galileo opened this issue Dec 30, 2021 · 1 comment
Open

Add the possibility to process or transform the message #164

fapena-galileo opened this issue Dec 30, 2021 · 1 comment
Labels
agent-java community Issues and PRs created by the community triage Issues and PRs that need to be triaged

Comments

@fapena-galileo
Copy link

fapena-galileo commented Dec 30, 2021

I need to be able to transform some messages. For example obfuscate some information. I want to be able to do that at the encoder level and not before on several components.

Now a days, the encode method add the message using
event.getFormattedMessage()

It could be very useful if we can add something similar to the following at the ECSEncoder class:

/**
 * Subclasses can override this to format the message (for example to obfuscate some fields.)
 * @param event The event to be logged
 * @return The message processed. By default, this method return the message without any modification
 */
protected String processMessage (ILoggingEvent event){
   return event.getFormattedMessage();
}

And at the encode method

EcsJsonSerializer.serializeFormattedMessage(builder, processMessage(event));

What do you think?

The method name could be process, transform, or just getMessage...

@github-actions github-actions bot added agent-java community Issues and PRs created by the community triage Issues and PRs that need to be triaged labels Dec 30, 2021
@ChristianCiach
Copy link

ChristianCiach commented Jun 24, 2024

I think this is already supported with #220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java community Issues and PRs created by the community triage Issues and PRs that need to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants