\(3log_a^2b-24log_b\left(a\sqrt[3]{b}\right)=-8\)
\(\Leftrightarrow3log_a^2b-24log_ba-8log_bb=-8\)
\(\Leftrightarrow3log_a^2b-\dfrac{24}{log_ab}=0\)
\(\Leftrightarrow log_a^3b=8\)
\(\Rightarrow log_ab=2\)
\(\Rightarrow P=log_aa+log_a\sqrt[3]{a}+log_a\sqrt[3]{b}=2017=1+\dfrac{1}{3}+\dfrac{1}{3}log_ab+2017\)
\(=\dfrac{4}{3}+\dfrac{2}{3}+2017=2019\)