I never have students memorize the formula you're trying to remember for that exact reason...
it's hard to remember which way it goes.
So, if you have log base a of b, you can write it as
x = log base a of b
rewrite it in exponent form
a^x=b
Then, log both sides
log a^x = log b
Use the exponent property of logs to move the x to the coefficient spot
x log a = log b
And finally, solve for x again...
x = log b / log a
And, there you have it.
(log without base written is intended to be log base 10)