Mathematica can't simplify some logarithmic expressions

Use RootApproximant

y1 = Log[Sqrt[2] + 1, 5 Sqrt[2] + 7];

y1 // RootApproximant

(* 3 *)

Verifying,

y1 == 3 // FullSimplify

(* True *)

y2 = Log[2 Sqrt[2] + 3, 17 - 12 Sqrt[2]];

y2 // RootApproximant

(* -2 *)

Verifying,

y2 == -2 // FullSimplify

(* True *)

You can use Reduce to solve the same problem in equation form:

Reduce[(Sqrt[2] + 1)^n == 5 Sqrt[2] + 7, n, Integers]

n == 3

Reduce[(Sqrt[2] + 1)^n == 17 - 12 Sqrt[2], n, Integers]

n == -4

Reduce[
  (5 Sqrt[2] + 7)^(c*n) == (3 + 2 Sqrt[2])^a (17 - 12 Sqrt[2])^b
  \[And] a != 0 \[And] b != 0 \[And] c != 0,
  n, Reals
]

a != 0 && b != 0 && c != 0 && n == -((-2 a + 4 b)/(3 c))