Let $R$ be an integral domain with unity, that is not a field, and $\mathfrak{m}$ a maximal ideal in $R$, that is not the $(0)$ ideal.
I am following a course in which I learned that when the localization $R_\mathfrak{m}$ of $R$ at $\mathfrak{m}$ is a discrete valuation ring, we can define a discrete valuation on $R$. Since all non-zero element in $R_\mathfrak{m}$ are of the form $u \pi^n$ for $u$ invertible, $\pi$ uniformizer and $n\geq 0$, the valuation is just defined to be $n$.
Is it possible to define valuations without using localization ? And is it possible to define a valuation in any ring $R$, with $R_\mathfrak{m}$ not necessarily a discrete valuation ring ?
My naive idea was to define a map $v_\mathfrak{m} : R \mapsto \mathbb{Z}_{\geq 0} \cup \{ + \infty \}$ such that $v_m(x) = \max\{ n\geq 0 : x \in \mathfrak{m}^n \}$ for all non-zero $x\in R$ and $v_\mathfrak{m}(0)=+\infty$. However, I'm not sure it will satisfy the properties of a valuation.
Thanks.