N.H. logging contractor sentenced to prison