Software: Click to open link
DebugView can capture information that is output by trace (Debug version) and OutputDebugString in the program. A program that supports debug, Release mode compilation (that is, the software captures the information that is thrown when the EXE is running directly , rather than when it is being debugged by Visual Studio), and even supports kernel programs, and can customize various filtering conditions so that you only see the output information of interest , and can be customized to highlight the content and so on, very convenient.
The program is very light: At present the latest 4.81, only 400 more K.
The software operating interface is as follows:
To capture debug information for the WIN32 program output in release mode, you need to select the capture Global Win32 option:
By programming some debugging information to DebugView, a total of three ways:
The OutputDebugString method in System.Diagnostics.Debug.WriteSystem.Diagnostics.Debugger.LogKernal32.dll
Where: The System.Diagnostics.Debug.Write method is only applicable to the compiler in debug mode EXE, the other two methods and debug and release mode compiled EXE generic.
First, System.Diagnostics.Debug.Write method (EXE generated by Debug mode)
for (int i = 0; i < i++) { System.Diagnostics.Debug.WriteLine ("Test debugview!! Deg "); }
The monitoring effect is as follows:
We can see that DebugView not only captures some of the information we need to output directly, but also some other useless information about the program, so how do we filter it?
"Include" means the string contained in the content, and "Exclude" is a string that is not included in the debug print content. As in include: "Deg" data. When you click OK, all content containing "GTA" is filtered out. Such as. After classifying the output, it is easy to exclude and catch the system anomaly. The Exclude method is similar. Specific example:
At this point, the previous useless information is filtered out.
Second, System.Diagnostics.Debugger.Log method (Debug and release general)
for (int i = 0; i < i++) { System.Diagnostics.Debugger.Log (0, NULL, "Test debugview!! Release "); }
Third, the OutputDebugString method in Kernal32.dll (Debug and release general)
1, introducing the OutputDebugString method in Kernal32.dll
[DllImport ("kernel32.dll", CharSet = CharSet.Auto)] public static extern void OutputDebugString (String message);
2. Use:
<pre name= "code" class= "CSharp" > for (int i = 0; i < i++) { outputdebugstring ("Test debugview! Jiankunking "); }
It's all about using DebugView to capture the local EXE program, so can you use it to capture information on the server?
Iv. capturing server information using DebugView
1. Place the DebugView software on the server, in the same directory as the program sibling:
Place the following bat command:
dbgview.exe/a/t/g/S
When you double-click the Bat command, the effect is as follows:
When you click Agree, the effect is as follows:
Double-click the icon in the lower right corner to see:
The DebugView is then started on the local machine and connected to the DebugView of the remote machine via connect, and when the debug information output is available in the remote machine, it is locally captured and displayed:
To set the connection IP:
Input IP:
At this point, the connection is established.
Here is still testing the "Kernal32.dll in the OutputDebugString method" in the EXE as the test source (the EXE will be placed on the server, start), after starting the EXE, the information can be detected as follows:
Small bet
1, DebugView and log4net can be used to record the log, what is the difference between the two?
Personal feeling log4net is an indispensable part of the log system, and DebugView more suitable for timely debugging, the specific choice depends on the individual. This article only explains the basic use of DebugView software, more information can be found in: DebugView official website
2. Remote server startup command DebugView Software's bat command: Click to open Link
Getting Started with DebugView debugging