logging: add concept of logfile and fix fprintf output
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>