I'm learning complex analysis, specifically holomorphic functions, and need help with the following exercise:
Examine if the function $\log(e^z - i)$ can be defined as a holomorphic function in the unit disk $\mathbb{D}$.
I wasn't able to do much except for this:
Let $f(x) = e^z - i$. We note that $e^z - i = 0 \iff e^xe^{yi} = e^{{\pi \over 2}i} \iff x = 0$ and $y = \frac{\pi}{2}$. The point $(0, \frac{\pi}{2}) \notin \mathbb{D}$ and therefore $f(z) \neq 0$ in $\mathbb{D}$.
This is as far as I got. I suspect the solution has to do with the existence of holomorphic logarithms on simply connected domains but I'm having difficulties understanding this concept.

You have already proved that $e^z-i$ is nowhere zero on $\mathbb{D}.$
$\textbf{Claim:} ~$If $f$ is analytic and nowhere zero in a simply connected domain $U$, then there exists a holomorphic branch of $\text{log}~f$. To prove this, you'll need to use the fact that a holomorphic branch of $\text{log}~f$ exists if and only if $\dfrac{f'}{f}$ has a primitive in $U$.
$\textbf{Explanation:}$ When we say a holomorphic branch of logarithm of a holomorphic function $f$ exists, we mean that $\exists$ a holomorphic function$~h$ such that $f=e^h$. Note that $\log f$ does not denote the usual branch of the logarithm on the image of $f$. It may not exist all the time, for example, consider $\exp:\mathbb{C}\to\mathbb{C_*}$.
Suppose $U$ is simply connected, $f:U\to \mathbb{C_*}, $ and a holomorphic branch of $\log f$ exists. Note that since $0 \not \in Im(f)$, $\dfrac{f'}{f}$ is well-defined and analytic on $U$. From $$f=e^h$$
we have, $$f'=h'e^h$$
or in other words,$$\dfrac{f'}{f}=h'$$
Which means that $\dfrac{f'}{f}$ has a primitive, namely $h$.
Now assume that $\dfrac{f'}{f}$ has primitive, say $g$. Since $g$ is holomorphic and $U$ is simply connected, $g$ has a primitive, say $h$ in $U$. Then, \begin{align*} &h'=g=\dfrac{f'}{f} \\ \implies&\bigg(fe^{-h}\biggl)^{'}=0\\ \implies&fe^{-h}=c\neq0\\ \implies&f=e^{h+k},~~~~\text{where} ~c=e^{k}. \end{align*}
Thus, $h+k$ is a holomorphic branch of the logarithm of $f$.
It only remains to prove that if $U$ is simply connected and $f$ is holomorphic in $U$, then $f$ has a primitive in $U$. This I leave as an exercise.