1
votes

How to prevent NServiceBus from logging my Azure storage connection string?

24/05/2014 10:55:21 NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.MessageDrivenSubscriptionManager: Subscribing to Test.Service.Messages.Events.BalanceUpdatedEvent, Test.Service.Messages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null at publisher queue Test@DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=YYY

1
Does this happen at every logging level?Adam Fyles
Which logging framework are you using? Depending on that you could configure it to leave these outYves Goeleven
PS: the long term solution for is to decouple the logical endpoint address from the physical endpoint address and only log the logical information, but this can't be done easilyYves Goeleven
@YvesGoeleven, I am using log4net. Separating physical and logical endpoint addresses would do the trick, but I also think that it would be a lot of work. My idea (still not implemented) is to intercept all log messages and just remove AccountKey=YYY part.SoftwareFactor

1 Answers

0
votes

Log4net has a filter mechanism that allows you to use StringMatchFilter to specify which content should not be logged. Maybe this can help?

<filter type="log4net.Filter.StringMatchFilter">
   <stringToMatch value="DefaultEndpointsProtocol=https;AccountName=" />
   <acceptOnMatch value="false" />
</filter>