lots of changes got Log to work properly