I'm having an issue where I cannot prevent the shutdown strategy in camel from logging my full URL. This is a problem because the URL has a password in it.
Neither of the .logMask()
calls suppress this log line. How can I go about preventing this from being logged?
context.addRoutes(new RouteBuilder() {
@Override
public void configure() {
from(uriString)
.logMask()
.process(exchange -> {
Message in = exchange.getIn();
// Doing some business logic here
})
.toD("direct:someOtherRoute")
.logMask();
}
});
The line being logged:
kafka://MY-TOPIC-NAME?saslJaasConfig=passwordThatShouldNotBeLogged&otherParams...
Edit: The full url is being logged both on startup and shutdown.
CompositConverter
, register it within your logback configuration and check whether the logline to log contains a password that you can then obfuscate or remove. ThroughMarker
, which can also be defined in Camel, one can specify that this special handling should only kick in in the presence or absence of such a defined log-marker – Roman Vottner Jan 7 '20 at 18:25