Fixed the last sonar warnings. Added log4j logger to print commands.