Is the unit of a value affected, when we take the log of the value?....
Example..
Log(24cm) i.e to base 10, is the cm, affected in some way?....
Although it might be log(24) , .. You know, after getting the final answer, is the unit cm affected?... Is the final value still in cm or it is unitless.??
The logarithm is a function between numbers, it doesn't and can not deal with units. If your equation can't be simplified to cancel the unit by $\log(\ldots \mathrm{cm} ) - \log(\ldots \mathrm{cm})$, then there is a certain mistake in your physical derivation.