Big update with new handling of log directories