proper order of log params
updated version
refactored
fixed bug where sensitive info could be exposed