Hogan was too young to enlist in the Union Army when the Civil War broke out, but his elder brother snuck him into the 31st Illinois Volunteer Infantry Regiment, a unit under the command of John A. Logan. His telegraphy skills were noticed and he was sent to serve under Ulysses S. Grant's brigade with the telegraph corps. He was awarded the rank of lieutenant and was later promoted to captain. He was at many of Grant's major battles, including Fort Henry, Fort Donelson, Corinth, Nashville, and Iuka.