Use logger instead of fprintf