Wrappers and layout renderers

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrappers and layout renderers

vidarkongsli
I expect that if I am using the AsyncWrapper, the layout renderers ${threadid} and ${threadname} would not necessarily output the id and name of the originating thread, but the thread writing to the log asynchronically. And in the same manner, if I use the ImpersonatingWrapper, the output of ${windows-identity} would be the identity that does the writing, and not the one from which the log entry originates.

Am I right?

Best regards,
Vidar
Reply | Threaded
Open this post in threaded view
|

Re: Wrappers and layout renderers

Jarek Kowalski
Administrator
No, they will capture the state of calling thread before going async, so they will output the right thing.

Jarek
On Feb 22, 2012, at 2:23 AM, vidarkongsli [via NLog Forum] wrote:

I expect that if I am using the AsyncWrapper, the layout renderers ${threadid} and ${threadname} would not necessarily output the id and name of the originating thread, but the thread writing to the log asynchronically. And in the same manner, if I use the ImpersonatingWrapper, the output of ${windows-identity} would be the identity that does the writing, and not the one from which the log entry originates.

Am I right?

Best regards,
Vidar


If you reply to this email, your message will be added to the discussion below:
http://nlog-forum.1685105.n2.nabble.com/Wrappers-and-layout-renderers-tp7307880p7307880.html
To start a new topic under NLog Forum, email [hidden email]
To unsubscribe from NLog Forum, click here.
NAML

NLog Blog
Reply | Threaded
Open this post in threaded view
|

Re: Wrappers and layout renderers

vidarkongsli
Thanks for your reply.

In the case of the ImpersonatingWrapper, I have now tested it on an ASP.NET 4 application running with Impersonation on IIS 7.5. After starting using <default-wrapper xsi:type='ImpersonatingWrapper' revertToSelf='true' />, the ${windows-identity} layout renderer now outputs the identity of the application pool, and not the end user.