Allocate/Deallocate resource in __init__ and release
Add log file support.