logging fix, misc tweaks

logging fix:
fix logfile configuration

misc tweaks:
add missing static in ptr<>
fix usage of reference on functions to avoid hack for void (*)()
throw informative exception on bad port number, use uint16_t