logging are working, but arguments of open() function are incorrect