Moved log code to log directory