Mapped Diagnostic context for .net

Last post 04-09-2009 10:20 AM by sosmary. 2 replies.

Sort Posts:

  • Mapped Diagnostic context for .net

    02-07-2009, 10:48 PM
    • Member
      40 point Member
    • sosmary
    • Member since 12-08-2008, 7:27 PM
    • Posts 73

    Hi,

    We have used the Mapped Diagnostic Context (MDC) in Java to store local values to be used later for logging purposes like the username, sessionId, etc.  Currently we are converting to .Net and we want to make use of the Enterprise Library 4.0. for logging and exception handling.   I am looking for the MDC equivalent for .Net. Any leads on this will be very useful.

    I appreciate all your useful inputs.

    Thanks,

    sosmary

  • Re: Mapped Diagnostic context for .net

    04-09-2009, 10:18 AM
    • Member
      40 point Member
    • sosmary
    • Member since 12-08-2008, 7:27 PM
    • Posts 73

    Hi,

    I was able to figure this out.  Here's what I did....the logging application block has an ExtraInformation provider class which gather context info, debug messages etc.   This class supports the following providers:

    ExtraInformation.DebugInformationProvider()

    ExtraInformation.ManagedSecurityContextInformationProvider()

    ExtraInformation.UnmanagedSecurityContextInformationProvider()

     Below is an example to get the security info ---- username and authentication details from the class.

    Imports Microsoft.Practices.EnterpriseLibrary.Logging.ExtraInformation

    Dim info As New ManagedSecurityContextInformationProvider

    Me.Username =  info.IdentityName.Trim

    Me.AuthType = info.AuthenticationType

    Me.IsAuthenticated = info.IsAuthenticated

    Thanks,

    sosmary

  • Re: Mapped Diagnostic context for .net

    04-09-2009, 10:20 AM
    • Member
      40 point Member
    • sosmary
    • Member since 12-08-2008, 7:27 PM
    • Posts 73

    Hi,

    I was able to figure this out.  Here's what I did....the logging application block has an ExtraInformation provider class which gather context info, debug messages etc.   This class supports the following providers:

    ExtraInformation.DebugInformationProvider()

    ExtraInformation.ManagedSecurityContextInformationProvider()

    ExtraInformation.UnmanagedSecurityContextInformationProvider()

     Below is an example to get the security info ---- username and authentication details from the class.

    Imports Microsoft.Practices.EnterpriseLibrary.Logging.ExtraInformation

    Dim info As New ManagedSecurityContextInformationProvider

    Me.Username =  info.IdentityName.Trim

    Me.AuthType = info.AuthenticationType

    Me.IsAuthenticated = info.IsAuthenticated

    Thanks,

    sosmary

Page 1 of 1 (3 items)