implement logging to log files