Add write part of logger