Added Logging Function

added Logging function and log rotation.
updated P text
Merge branch 'Testing'