def daemon_file_name(base_name=None, host=None, instance=None):
#===============================================================================
    """
    Build a daemon output file name using optional base name, host, and instance.
    """
    names = []
    if not base_name is None:
        names.append(base_name)
    if not host is None:
        names.append(host.replace(':', '_'))
    if not names:
        names.append('server')
    if not instance is None:
        names.append('_%d' % instance)
    daemon_name = ''.join(names)
    return daemon_name