Add logdir param

Added a parameter for logPath to be passed from the caller.