1st steps for logging: schema & refactoring;also improvements in doc