Dispose event log and make add check for NRE

Make sure to close ClientHandlers event log
Add null check in Log function to prevent NRE
Remove while which is never iterated

Remove while loop since we always run it once