How to use LogFormatter for sanitize #5321
Answered
by
ikhoon
evgeny-mordyasov
asked this question in
Q&A
-
I want to configure the login in the application using methods requestHeadersSanitizer() and requestContentSanitizer(). But they are marked as deprecated. As an alternative, they suggest using LogFormatter. But I haven't found detailed information anywhere on how to do this.
Armeria version: 1.25.2 |
Beta Was this translation helpful? Give feedback.
Answered by
ikhoon
Dec 4, 2023
Replies: 1 comment
-
You can see the new builder methods for the deprecated APIs in LogFormatter logFormatter =
LogFormatter
.builderForText()
.requestHeadersSanitizer(...)
.requestContentSanitizer(...)
...
.build();
LoggingService
.builder()
.requestLogLevel(LogLevel.INFO)
.successfulResponseLogLevel(LogLevel.INFO)
.failureResponseLogLevel(LogLevel.WARN)
.logFormatter(logFormatter)
.newDecorator(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ikhoon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can see the new builder methods for the deprecated APIs in
TextLogFormatterBuilder
.For example, your code can be migrated as shown below.