Guard the logger calls with #if LOG4NET