Add support for creating log directory if it doesn't already exist