Is there a general principle on whether one should compute pearson correlation for two random variables X and Y before taking their log transform or after? Is there a procedure to test which is more appropriate? They yield similar but different values, since log transform is non-linear. Does it depend on whether X or Y are closer to normality after log? If so, why does that matter? And does that mean that one should do a normality test on X and Y versus log(X) and log(Y) and based on that decide whether pearson(x,y) is more appropriate than pearson(log(x),log(y))?
Because $\log(X)$ and $\log(Y)$ are monotonic transformations of the data $X$ and $Y$, you might also choose to use Spearman's rank correlation ($\rho_S$) and not worry about transforming your data, as you would get $\rho_S(X,Y) = \rho_S(\log(X),\log(Y))$
Correlation(pearson) measures a linear relationship between two continuous variables. There is no such choice for (X,Y) or (log X, log Y). Scatter plot of the variables can be used for understanding of the relationship.
The following link may answer regarding normality issue. link
Pearson correlation is for parametric testing and is more powerful than non-parametirc test. Thus, we opt to use transformation before any non-parametric procedures. Transform your data and get pearsons correlation. That's it.