added file logging, disabled freeing packetbuffer and pcapclose after pcapread function