Avoid logging in TransactionManager_DistributedTransactionStarted?

15 views
Skip to first unread message

ErikZ

unread,
Nov 17, 2014, 9:54:39 AM11/17/14
to nginn-me...@googlegroups.com
I have a program that uses NGinn. If I start a distributed transaction in any part of my program, Nginn logs this in TransactionManager_DistributedTransactionStarted(in SqlTransport2).

Is it possible to only log transactions started by Nginn in TransactionManager_DistributedTransactionStarted?

Thanks,
Erik



nginn-messagebus

unread,
Nov 18, 2014, 5:39:48 PM11/18/14
to nginn-me...@googlegroups.com
Hi Erik,

Currently we're logging all distributed transaction promotions and I'm afraid it's not possible to tell who started them without looking at a stack trace (actually this code was used for finding distributed transactions early and getting rid of them - I can imagine it's quite annoying if you want to have transactions and get all this junk in logs too). So my advice is to disable logging of that information through NLog configuration.
The code:

var log = LogManager.GetLogger("DTC");
log.Info("***\nDistributed transaction started (Message: {1})! {0}***\n", e.Transaction.TransactionInformation.LocalIdentifier, _curMsg == null ? "none" : _curMsg.Message.BusMessageId);

so you need to disable logging for 'DTC' logger or set its logging level above Info            
I think i'll remove this code entirely in next release, but currently i can't tell when it will be.

Best regards
Rafal
Reply all
Reply to author
Forward
0 new messages