Lps 49294 local variables

This is a forward of a pull request sent to and rejected by Brian because _log was not being reorganized to be first in all situations - I know that we addressed this a little bit, but apparently it needs more attention. 

See https://github.com/brianchandotcom/liferay-portal/pull/20774