def to_file(output_file, encoder=EliotJSONEncoder):
    """
    Add a destination that writes a JSON message per line to the given file.

    @param output_file: A file-like object.
    """
    Logger._destinations.add(
        FileDestination(file=output_file, encoder=encoder)
    )