Let $\sum_na_n^2$ converge. We have
where $\xi_n$ lies between $0$ and $a_n$. Thus we can split $\sum_n\log(1+a_n)$ into three series. The first two converge by hypothesis. In the third, since $\sum_na_n$ converges, $\xi_n$ goes to $0$, so the term containing it is bounded by a constant. Also $\sum_n|a_n^3|$ is dominated by $\sum_na_n^2$, so the third series converges absolutely and thus converges; hence $\sum_n\log(1+a_n)$, being the sum of three convergent series, also converges.
Conversely, let $\sum_na_n^2$ diverge. Since $\sum_na_n$ converges, $a_n$ goes to $0$, so for sufficiently large $n$
Thus the sum over these two terms diverges, and since $\sum_na_n$ converges, it follows that $\sum_n\log(1+a_n)$, being the sum of a convergent series and a divergent series, diverges.