Extra pid and log file path generation into a method.