logging: Use logname for name of logfile, so that multiple instances have different log files