import tempfile


def get_logprop_file(logger, template, pattern, project):
    """
    Return the filename of file with logging properties specific for given
    project.
    """

    with open(template, 'r') as f:
        data = f.read()

    data = data.replace(pattern, project)

    with tempfile.NamedTemporaryFile(delete=False) as tmpf:
        tmpf.write(data.encode())

    return tmpf.name