Palatini formulation of modified gravity with lnR terms