Since the feasible discrete set `RealAbs[Sqrt[2] - x / y] < 0.0001` is infinite, this is a hard task for `NMaximize`. It can be done as follows. First, we find the maximum for `x >= 100 && y >= 100` by NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], Element[{x, y}, Integers] && x >= 100 && y >= 100 && RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}] which produces `{1.49309, {x -> 15043, y -> 10637}}` and a warning > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution. The above result is a feasible solution in view of N[RealAbs[Sqrt[2] - x/y] /. {x -> 15043, y -> 10637}] > `9.718*10^-7` Second, in order to be sure, we apply the known lower estimate for `RealAbs[Sqrt[2] - x/y]` (see the "Liouville numbers and transcendence" section in [that Wiki article](https://en.wikipedia.org/wiki/Liouville_number#Liouville_numbers_and_transcendence) for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 3$. This inequality implies the inequality `ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/3] + 2]`. It is clear the maximum of ` Log[1/y, 1/3] + 2]` for all integers `y >=100 ` is attained at `y==100` and is equal to `N[Log[1/100, 1/3]]==0.238561`. Third, now we apply counting for `x>=1&&x<=99&&y>=2&&y<=99` Do[If[RealAbs[Sqrt[2] - x/y] < 0.001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]], {x, 1, 99}, {y, 2, 99}] > `{41,29,2.30873} {58,41,2.09337} {75,53,1.77184} {82,58,1.91461} {99,70,2.24473}` Summarizing the above, we draw the conclusion that the maximum under consideration is equal to `2.30873` at `{x==41,y==29}`.