  We consider the following prescribed $Q$-curvature problem
\begin{equation}\label{uno} \begin{cases} \Delta^2 u=(1-|x|^p)e^{4u},
\quad\text{on}\,\,\mathbb{R}^4\\
\Lambda:=\int_{\mathbb{R}^4}(1-|x|^p)e^{4u}dx<\infty. \end{cases}
\end{equation} We show that for every polynomial $P$ of degree 2 such that
$\lim\limits_{|x|\to+\infty}P=-\infty$, and for every
$\Lambda\in(0,\Lambda_\mathrm{sph})$, there exists at least one solution which
assume the form $u=w+P$, where $w$ behaves logarithmically at infinity.
Conversely, we prove that all solutions have the form $v+P$, where
$$v(x)=\frac{1}{8\pi^2}\int\limits_{\mathbb{R}^4}\log\left(\frac{|y|}{|x-y|}\right)(1-|y|^p)e^{4u}dy$$
and $P$ is a polynomial of degree at most 2 bounded from above. Moreover, if
$u$ is a solution to the previous problem, it has the following asymptotic
behavior
$$u(x)=-\frac{\Lambda}{8\pi^2}\log|x|+P+o(\log|x|),\quad\text{as}\,\,|x|\to+\infty.$$
As a consequence, we give a geometric characterization of solutions in terms of
the scalar curvature at infinity of the associated conformal metric
$e^{2u}|dx|^2$.
