Added Logging function and getremoteip()