locked
biztalk trace data in DebugView RRS feed

  • Question

  • HI experts,

    Am trying to read the trace data from biztalk expression shape to debugview.So i downaloaded

    debugview, but i am unable to trace the data.

    This is my expression.

     System.Diagnostics.Trace.WriteLine("data")

    can any one tell me

    1.)How to achieve this in step by step pls.

    2.)How can i disable them in production server.

    Needed urgently please....

     

    Tuesday, March 1, 2011 8:20 AM

Answers

  • Hi Venkat,

    Lets take this question as two folds:

    1. To view tracing/debug code in the DebugView tool
    2. Disable tracing in production server

    To view tracing/debug code in the DebugView tool:

    To make the base clear, hope you know about the DebugView. Its not data store for debug/trace outputs. Its just a "viewing" tool. It lets you to monitor the debug/trace output on your local system. So you have to keep it open while running your application and you can see the debug/trace output in Debugview while its "being written".

    If you're clear with this. To start with, if you're not seeing the trace output being written then enable all the options under "Capture" menu. Including the "Capure Kernal" and "Enable Verborse Kernal Output". Though this options are nothing to do with what you're looking after, just enable them to make sure you have enabled all the capturing "flags" of the DebugView tool.

    Ensure you have connected to the correct computer where you application is being writing the trace/debug outputs. You can check this under "Computer" menu

    Ensure you have no filters. Click on the filter/Highlight icon (cone shaped icon) or press Control and L. And ensure you have "*" in "Include" dropdown and in "Exclude" nothing is selected. This ensures that you have no filters for the tool to view.

    And if you're still not view the trace/debug output, then as last option restart your computer. This sometime helps.

    Disable tracing in production server:

    For getting the trace in non-production server. Better option would to use "Debug" class instead of "Trace class" and build your application in debug mode. The System.Diagnostics namespace provides two classes named Trace and Debug that are used for writing debug/trace logs while execution of your application. These two classes are the same, except that the methods of the Trace class become part of the release build code whereas methods of the Debug class don't become part of the release build executable.

    So use System.Diagnostics.Debug.WriteLine("Data") in your expression shape and also ensure you have set the application's build configuration to "Debug" in Visual Studio. For production servers, obviously you should build your applications in "Release" mode. Release builds doesn't out the debug traces.

    For custom trace listeners check this article .

     

    Hope this helps.

     

    Cheers

    M.R.ASHWINPRABHU


    If this answers your question please mark it accordingly
    • Marked as answer by sandydv85 Tuesday, March 1, 2011 1:16 PM
    Tuesday, March 1, 2011 10:11 AM
  • Yes Venkat, you need to build application in release mode for avoiding the debug codes.

    Yes you can view the message using Debug.WriteLine

    Use this:

    Create a XMLDocument type variable in orchestration. Then use the following code in the expression shape:

    xmlDoc = MsgSample;

    System.Diagnostics.Debug.WriteLine(xmlDoc.OuterXML);

    This should log the BizTalk message into the tracelistenser which you can see using the tool like DebugView.

     

    Cheers

    M.R.ASHWINPRABHU



    If this answers your question please mark it accordingly
    • Proposed as answer by M.R.Ashwin Prabhu Tuesday, March 1, 2011 11:52 AM
    • Marked as answer by sandydv85 Tuesday, March 1, 2011 1:16 PM
    Tuesday, March 1, 2011 11:50 AM

All replies

  • HI,

    I do already seen that, am getting values, but how can i disable them in production server.

    Is there any piece of code that should be added in btsntsvc.exe config?If so pls tell me wht is that?

    Tuesday, March 1, 2011 9:09 AM
  • The DEBUG flag is a compiler flag, so the only way to disable it is to recompile your solution without the flag.  It's common for people to use the DEBUG flag for development, and then to switch it off before you deploy into a production environment.

    You have some control over tracing through the config file, but to disable it completely you need to stop the code from being compiled.


    If this is helpful or answers your question - please mark accordingly.
    Because I get points for it which gives my life purpose (also, it helps other people find answers quickly)
    Tuesday, March 1, 2011 9:17 AM
  • Hi Grant,

    I am asking you about biztalk trace properties 

    System.Diagnostics.Trace.WriteLine("data")

    In an expression shape, Am getting the data in debugview.

    But I don't know how to disable it in Live production server.

    Does any one know?

    Tuesday, March 1, 2011 9:31 AM
  • System.Diagnostics.Trace.Writeline("data") will be compiled in both Debug and Release mode.
    Another option is to use the Debug.Write, this will not be compiled into the code when compiling in Release mode.


    Glenn Colpaert - MCTS BizTalk Server -  Blog : http://blog.codit.eu
    Tuesday, March 1, 2011 9:59 AM
  • Hi Venkat,

    Lets take this question as two folds:

    1. To view tracing/debug code in the DebugView tool
    2. Disable tracing in production server

    To view tracing/debug code in the DebugView tool:

    To make the base clear, hope you know about the DebugView. Its not data store for debug/trace outputs. Its just a "viewing" tool. It lets you to monitor the debug/trace output on your local system. So you have to keep it open while running your application and you can see the debug/trace output in Debugview while its "being written".

    If you're clear with this. To start with, if you're not seeing the trace output being written then enable all the options under "Capture" menu. Including the "Capure Kernal" and "Enable Verborse Kernal Output". Though this options are nothing to do with what you're looking after, just enable them to make sure you have enabled all the capturing "flags" of the DebugView tool.

    Ensure you have connected to the correct computer where you application is being writing the trace/debug outputs. You can check this under "Computer" menu

    Ensure you have no filters. Click on the filter/Highlight icon (cone shaped icon) or press Control and L. And ensure you have "*" in "Include" dropdown and in "Exclude" nothing is selected. This ensures that you have no filters for the tool to view.

    And if you're still not view the trace/debug output, then as last option restart your computer. This sometime helps.

    Disable tracing in production server:

    For getting the trace in non-production server. Better option would to use "Debug" class instead of "Trace class" and build your application in debug mode. The System.Diagnostics namespace provides two classes named Trace and Debug that are used for writing debug/trace logs while execution of your application. These two classes are the same, except that the methods of the Trace class become part of the release build code whereas methods of the Debug class don't become part of the release build executable.

    So use System.Diagnostics.Debug.WriteLine("Data") in your expression shape and also ensure you have set the application's build configuration to "Debug" in Visual Studio. For production servers, obviously you should build your applications in "Release" mode. Release builds doesn't out the debug traces.

    For custom trace listeners check this article .

     

    Hope this helps.

     

    Cheers

    M.R.ASHWINPRABHU


    If this answers your question please mark it accordingly
    • Marked as answer by sandydv85 Tuesday, March 1, 2011 1:16 PM
    Tuesday, March 1, 2011 10:11 AM
  • I sometimes used a custom Log component called Log4Net for logging purposes. With Log4Net you can output the logging to different targets (File, DB, Eventlog, ..) and also configure the log level (Debug, Info, Error) in a .config file.

    http://logging.apache.org/log4net/release/features.html

    I don't know if this is a desirable solution for your case, because as I understand you correctly you need a quick solution. But I'd like to mention it anyway. Maybe in future scenarios it might be helpful?

     


    If this answers your question please mark it accordingly
    Tuesday, March 1, 2011 10:16 AM
  • HI Aswin,

    Am really pleased with your solution.

    U mean to say i can use 

    System.Diagnostics.Debug.WriteLine("Data") in the expression shape and when the

    code is moving to live i need to build applications in "release mode"..Right?

    Can i view the Messagedata(xml) in 

    System.Diagnostics.Debug.WriteLine("Messagedata")?


    Tuesday, March 1, 2011 11:39 AM
  • Thanks Nicky for your answer, But i think using debugview is easier than Log4net.

     

    Tuesday, March 1, 2011 11:43 AM
  • Yes Venkat, you need to build application in release mode for avoiding the debug codes.

    Yes you can view the message using Debug.WriteLine

    Use this:

    Create a XMLDocument type variable in orchestration. Then use the following code in the expression shape:

    xmlDoc = MsgSample;

    System.Diagnostics.Debug.WriteLine(xmlDoc.OuterXML);

    This should log the BizTalk message into the tracelistenser which you can see using the tool like DebugView.

     

    Cheers

    M.R.ASHWINPRABHU



    If this answers your question please mark it accordingly
    • Proposed as answer by M.R.Ashwin Prabhu Tuesday, March 1, 2011 11:52 AM
    • Marked as answer by sandydv85 Tuesday, March 1, 2011 1:16 PM
    Tuesday, March 1, 2011 11:50 AM
  • HI Aswin for the above one,

    Do i need to make any changes in btsntvsc.exe.config file?

    Tuesday, March 1, 2011 12:02 PM
  • Nope. You don't need to touch anything in btsntsvc file.

     

    Cheers

    M.R.ASHWINPRABHU



    If this answers your question please mark it accordingly
    Tuesday, March 1, 2011 12:35 PM
  • Thanks aswin...
    Tuesday, March 1, 2011 1:16 PM