Moved logging initialization code up

Now various subsystems like cache can report their errors
with correct log levels while initializing.
Merge pull request #2 from andrey-malets/fix-init

Moved logging initialization code up