Real Time Remote Log File Viewing for Windows Mobile

For a few years now I’ve been trying to find a remote log viewer so that I can see log files as they update while I’m debugging .NET Compact Framework applications from my PC. Visual Studio comes with a number of remote apps, but none of these are capable of updating in real time, and I didn’t have the time or energy to write one myself. Then one day while browsing through Log4net documentation when I came across the TelnetAppender.

Stick this in your log4net config file:

<appender name="tnet" type="log4net.Appender.TelnetAppender">
  <port value="23" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%-5p [%t]: %m%n" />
  </layout>
</appender>

then add the appender to your <root> element, and you can telnet into your handheld device and monitor the log file as it comes in in realtime!

Simple CSV Merge Script

Merges CSV files using only the header of the first file.

Usage:

./mergecsv.pl filename filename > outfile

Code:

#!/usr/bin/perl -w

my $headers = '';
while (<>) {
  if($headers eq ''){
      $headers = $_;
      print $_;
  }
  if($headers ne $_){
    print $_;
  }
}