Logic is (according to the Oxford English Dictionary) 'the branch of philosophy that treats of the forms of thinking in general, and more especially of inference and of scientific method. (Prof. J. Cook Wilson,)' and is 'also, since the work of Gottlob Frege (1848–1925,) a formal system using symbolic techniques and mathematical methods to establish truth-values in the physical sciences, in language, and in philosophical argument'. Everything in logic, in the philosophical sense, can actually be expressed mathematically. Basic logic (starting from Aristotle of Stagira's Organon) is used in teaching arithmetic and geometry, and problem-solving logic is taught for intermediate math, and the reasoning & logic used to prove mathematical ideas is taught in advanced math, including higher arithmetic (number theory) and formal geometry, etc.
Different mathematicians argue for using some theory or another, beyond basic axioms, as a fundamental part of logic, yet these remain distinct subjects. Even though number theory was some of the first abstract math, in the modern age, mathematicians influenced by materialist science claimed set & category theory was fundamental. However, numbers are fundamental to all math, and sets and categories are fundamental to none.
Mathematicians must practice the skill of logic and should study formal logic, such as in college/university, but actually as soon as they can in life (such as in late primary school, or secondary school, if they can study formal geometry and do proofs).