move buf to log struct