Print DebugLog to a textbox?

I have my code here:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Historie : MonoBehaviour
{

    void OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log("Entered trigger");
    }

    void OnTriggerStay2D(Collider2D other)
    {
        Debug.Log("Staying In Trigger");
    }

    void OnTriggerExit2D(Collider2D other)
    {
        Debug.Log("Exiting trigger");
    }

}

My trigger is a box with IsTrigger enabled. I want the text to appear in a textbox on the screen instead of it appearing in the console. I just dont know how.

I am using C#

create a text object in the editor, add a var to that script public Text textObject; and change the Debug.Log to textObject.text = “Exiting trigger”; and in the inspector click the object who has that scirpt and drag and drop the text you have created to the textObject property.