If you want to actually log system startup and shutdown - you can't. This is impossible for a userland program, and wouldn't be a reliable figure if from a driver component because the kernel would load/unload the driver after/before itself.
The only other suggestion I can make is by looking at events in the Event Log, but I don't know how that works on Windows Phone.
Getting information on system uptime can be done using the WMI Performance Counters (exposed via the System.Diagnostics.PerformanceCounter class in .NET, which is not available on Windows Phone). You'd want to look for specific counters in the WMI System namespace
Windows Phone 8, based on NT, should have WMI somewhere in the system, but my few searches haven't found anything relevant.