Situtation
I have a FEZ Cobra II NET running test code. It sends data every second to a server on the LAN. The server writes the data to a text file. After 27 hours and 97,200 successful sends, the Cobra stops sending. Clearly I am not going to debug for 27 hours, and I am not sure how else to trouble shoot, because standard software trouble shooting approaches do not apply.
Question
- If I were to write to log errors on the Cobra, how would I access them?
- Does NETMF have application logs? How can we access them?
- Is there an event viewer?
- What other trouble shooting / debugging steps are viable here?
Code
public class Program
{
private static Timer timer;
private Network network;
public static void Main()
{
Program p = new Program();
p.network = new Network();
p.RepeatedlySendDataToWcfService();
Thread.Sleep(Timeout.Infinite);
}
private void RepeatedlySendDataToWcfService()
{
Program.timer =
new Timer(this.TimerCallback_SendSbcData, new object(), 0, 1000);
}
private void TimerCallback_SendSbcData(object stateInfo)
{
SbcData data = new SbcData();
this.network.Send(data);
}
}
Search and Research
As the Fez has a memory card slot, you could log send errors to that:
private void TimerCallback_SendSbcData(object stateInfo)
{
try
{
SbcData data = new SbcData();
this.network.Send(data);
}
catch (Exception ex)
{
MyLogToCardMethod(ex.ToString());
}
}
Mounting the card instructions are on the manufacturer site:
来源:https://stackoverflow.com/questions/22946632/how-do-we-trouble-shoot-a-long-running-netmf-program-that-stops-in-production