Suppose $\lim_{x\to c}f(x)=\lim_{x\to c}g(x)=f(c)=g(c)=0$. Suppose furthermore that $f'(c)$ and $g'(c)$ both exist and (most important here) $g'(c)\not=0$. Then it does not require L'Hopital's rule to conclude
$$\lim_{x\to c}{f(x)\over g(x)}={f'(c)\over g'(c)}$$
This is because we can write
$$\lim_{x\to c}{f(x)\over g(x)}=\lim_{x\to c}{\displaystyle{f(x)-f(c)\over x-c}\over\displaystyle{g(x)-g(c)\over x-c}}={\lim_{x\to c}\displaystyle{f(x)-f(c)\over x-c}\over\lim_{x\to c}\displaystyle{g(x)-g(c)\over x-c}}={f'(c)\over g'(c)}$$
Here the first equality uses the assumption that $f(c)=g(c)=0$, the second equality uses the general "distributive" law of limits, that $\lim(F/G)=(\lim F)/(\lim G)$ provided $\lim F$ and $\lim G$ both exist and (most important) $\lim G\not=0$, and the third equality uses the definition of the derivative.
For that problem at hand,
$$g(x)=\cos^2x-e^x\implies g'(x)=-2\cos x\sin x-e^x\implies g'(0)=-1\not=0$$
and thus we can proceed with
$$f(x)=\ln(e+x)-e^x\implies f'(x)={1\over e+x}-e^x\implies f'(0)={1\over e}-1$$
so that
$$\lim_{x\to0}{\ln(e+x)-e^x\over\cos^2x-e^x}={{1\over e}-1\over-1}=1-{1\over e}$$
In summary, this may look like L'Hopital, but it is not. Roughly speaking, L'Hopital is not needed unless $f'(c)$ and $g'(c)$ both exist but are both equal to $0$.