move log filename into the init.d script
keep track of the socket and xhr retry counts in different vars