call openlog only once