pH of aqueous solution of HCl of low concentration
It is known that the equilibrium constant for the following reaction is $10^{-14}$.

$$\ce{2H2O(l) &lt;=&gt; H3O+(aq) + OH-(aq)}$$

That means,

$$\frac {[\ce{H3O+(aq)}][\ce{OH-(aq)}]} {[\ce{H2O(l)}][\ce{H2O(l)}]} = 10^{-14}$$

where the concentration of water $[\ce{H2O(l)}]$ is assumed to be $1$.

Initially, we have $[\ce{H3O+(aq)}] = 10^{-8}$.

Then, assuming that $x$ moles of $\ce{H3O+(aq)}$ is generated. An equal amount of $\ce{OH-(aq)}$ must also be generated:

$$(10^{-8}+x)(x) = 10^{-14}$$

Solving for $x$ gives $x = 9.51 \times 10^{-8}$.

So, the total concentration of $\ce{H3O+(aq)}$ is $1.051\times10^{-7}$.

Therefore, the pH is $6.978$.



The problem with your approach

Let the initial molarity of the hydronium ion be $a$.

Solving $(a+x)(x) = 10^{-14}$, if $a$ is well above $10^{-5}$, gives $x \approx 0$.

The approximation that the pH is equal to $-\log{{\left([\ce{HCl(aq)}]\right)}}$ is only accurate for normal concentrations.