Problem calculating joint and marginal distribution of two uniform distributions

Suppose we have random variable $X_1$ distributed as $U[0,1]$ and $X_2$ distributed as $U[0,X_1]$, where $U[a,b]$ means uniform distribution in interval $[a,b]$.

I was able to compute joint pdf of $(X_1,X_2)$ and marginal pdf of $X_1$.

However while computing marginal pdf of $X_2$ I am encountering limits problem. The resultant of integral through marginal of $X_2$ is $\log(X_1)$ and the limits are from 0 to 1. As $\log(X_1)$ is not defined for $X_1=0$, I am facing a difficulty.

Am I wrong somwhere? Thanks.

In the “marginalisation” integral, the lower limit for $x_1$ is not $0$ but $x_2$ (because of the $0 condition).