Use tracing to generate log (data synchronization logs) [device]
The principle of debugging on the device and desktop the same, but the relevant configuration files are different, the first time read this article friends, please refer to the "desktop article"
The principle of using tracing and desktop is the same on device, only slightly different configuration methods.
Because the wince Sync Service for Ado.net does not publicly declare support for tracing production log, configuring in App.config is ineffective and the correct configuration method is as follows:
On the wince platform, create a new configuration file named: Trace.config.txt
Put this file into the directory of your EXE program (very IMPORTANT!) )
Then add the following to the configuration file:
<? xml version="1.0" encoding="utf-8" ?>
<configuration>
<traceSettings>
<add key ="FileLocation" value="test.txt"/>
<add key ="LogLevel" value="4"/>
</traceSettings>
</configuration>
After the program is run, the tracing Log is generated.
2 points to note:
Make sure your trace.config.txt and your EXE program are in the same directory, otherwise log will not be generated. An empirical approach is to add trace.config.txt to your vs soltuion so that when deployment, Trace.config.txt will automatically deploy to device.
If you do not specify a path to the log file, the default is to put it in the device directory (root).
Related information:
Http://msdn.microsoft.com/en-us/library/cc807160.aspx
Source: http://liangyiming.cnblogs.com