Added custom logging mechanism.