Added full logging functionality.