How can I draw a ray for direction object is moving?

Hi, I’ve been trying to get a ray to draw in the direction a cube is facing but I don’t understand how. The reason I’m trying to do this is because I’m making a random moving AI that will rotate in a random direction and move forward.

Here is my code:
if( counter <= 0){
counter = 100;
dir = Random.Range(0,360);
transform.eulerAngles=new Vector3(0,dir,0);

		counter --;
	Debug.DrawRay(transform.position,new Vector3(transform.position.x,transform.eulerAngles.y,transform.position.z));

Debug.DrawRay(transform.position, transform.forward * 5.0f);

The '5.0’determines the length of the ray. Without this value, the ray will be 1.0 in length and therefore stick out of a 1x1x1 cube by only 0.5.