What happens when you retrieve the current thread id on your own and include it in the log message? Does it match %t?
I believe LoggingEvent by default captures the current thread id at the time the log is being generated then makes that available as %t. FixFlags is the property name. I think FixFlags.Partial is the default: http://logging.apache.org/log4net/release/sdk/log4net.Core.FixFlags.html ________________________________ From: Randar101 <[email protected]> To: [email protected] Sent: Friday, May 3, 2013 10:53 AM Subject: ThreadID not changing We have an application that has the following architecture: -IIS -WCF RIA Services. -Silverlight client -We log on both the client and the server and use Clog to send the logs from the client My issue is with our server logs. Whenever log4net logs the threadId, it seems to be the same until something big happens (i.e. IIS Reset). So the log file looks like this even though these are two users hitting it at the same time. Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, , TestUser3, Debug,Currently logged in as TestUser3 Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, uo2sexbeikaej0hpwoiylxxz, TestUser3, Debug,Initializing UserManagementDomainService Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, uo2sexbeikaej0hpwoiylxxz, TestUser3, Debug,[UserManagementDomainService] running query [GetUserManagementCacheData] Thread[146] Instance[New] Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, , , Debug,"Begin [/Services/TheApplicationSys-RC-Client-RIA-Models-Services-SettingsDomainService.svc/Soap] Type=Service,IP=::1" Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, , TestUser6, Debug,Currently logged in as TestUser6 Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, u5avnhurwzctmzrep1sxafw1, TestUser6, Debug,Initializing SettingsDomainService Server: 02/05/2013 18:16:16, GMT-05:00, 149, u5avnhurwzctmzrep1sxafw1, TestUser6, GetUserDictionary, [PROFILING], 11, 5001fe21-7d56-4719-89af-510674543765, Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, , TestUser6, Debug,"End [/Services/TheApplicationSys-RC-Client-RIA-Models-Services-SettingsDomainService.svc/Soap] Type=Service,IP=::1,Page=TheApplicationSys-RC-Client-RIA-Models-Services-SettingsDomainService.svc;Duration=11.670ms,User=TestUser6" Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, , , Debug,"Begin [/Services/TheApplicationSys-RC-Client-RIA-Models-Services-FeatureLicenseDomainService.svc/Soap] Type=Service,IP=::1" Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, , TestUser6, Debug,Currently logged in as TestUser6 Server: 02/05/2013 18:16:16, GMT-05:00, ThreadId:179, u5avnhurwzctmzrep1sxafw1, TestUser6, Debug,Initializing FeatureLicenseDomainService Once something happens, the thread ID changes and is then consistently that number. Looking through our code, we don't explicitly set the threadID, so it has to coming form Log4net. There is nothing that would lead us to believe that our application is actually single threaded. We are setup for “Single” ConcurrencyMode and “PerSession”, which means that every unique client may get a new thread. We run some fairly heavy load tests and can see what looks very much like parallel activity. I've looked at our log files for very busy environments (production, QA, etc.) and they all seem to behave the same. So at this point, it feels like a logging issue and not a threading issue. Has anybody seen this or have a solution? The appender is as follows: <appender name="ServerFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="Log\TheApplication.log" /> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <maxSizeRollBackups value="2" /> <rollingStyle value="Size" /> <maximumFileSize value="10MB" /> <countDirection value="1"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%property{logId}: %date{dd/MM/yyyy HH:mm:ss}, %property{timeZoneOffset}, ThreadId:%t, %property{sessionId}, %property{userName}, %property{level},%message%newline" /> </layout> </appender> -- View this message in context: http://apache-logging.6191.n7.nabble.com/ThreadID-not-changing-tp37154.html Sent from the Log4net - Users mailing list archive at Nabble.com.
