make dir for addfile log in log path func

Check for directory existence in the function that returns the
path rather than in the code that calls the function (so we don't
have to check for dir in multiple places).