There are multiple ways of answering this question that would appease different schools of thought about the metaphysical nature of logic, mathematics, reality, and cognition. This concretizes itself into different kinds of ansatz of inquiry, and ultimately 'logic' stratifies into distinct concepts.
Now, pushing the wild gardens of philosophy to the side for a bit, tracking down 'logic' in mathematics is not as easy as it might seem from how unambiguous the discipline might look from the outside. Taking the axiomatic approach to maths, as, e.g., Hofstadter does in GEB, will lead you to say that logic in maths are the rules we agree on to move from one ontologically-True theorem to an other, then, logic's entire role is to effectively (re-)assure us that the accessible is True and that our construction is self-consistent.
In practice this is more complicated, because mathematics is not just the polished product of decades research and refinement. Mathematical research necessitates the important step of a "non-Logical" ontogenesis before it can move on embedding and refining the logical steps of a theory: theorists will first apply and transpose intuitions to generate (define) concepts objects that seem interesting (not yet even truth-apt), and only subsequently embed them in a body of work in which the concepts become well(-enough)-defined to be subjected to logical analysis. That is to say, not all mathematics (or the mathematical process) is (or, imo, should be) constructivist, and non-constructivist maths follows rules of logic that are much more about what the community finds to be a good(-enough) argument than closely laying out every logical steps building up to a certain theorem; logic leaks into a distributed process happening in the emergent collective intelligence of the research community, and that is much more difficult to pin down. In short: logic in mathematics is not in general studied per-se, it is something one does, a nebulous set of (sometimes surprisingly implicit) rules that one has to follow for their results to be recognized.
If the question is more specifically about the study of logic as a branch of mathematics, then we can start thinking about meta-mathematics, or the sets of theorems (like Godel's) that specifically use maths to talk about what maths can or cannot do, and that practice is very different from philosophy, because it is fully embedded in the mathematical ontic, and thus 'results' are not claimed (or required) to have any correspondence with colloquial concepts.
In turn, 'philosophy' is very varied. Some people studying logic will in effect only care about Capital 'L' Logic as is often studied in the context of stereotypical analytical philosophy. But logic, reason, and by extension cognition and language, have been the focus of many non-analytical philosophers, like, say, Derrida, who definitely both uses and studies forms of logic pretty rigorously.
That said, the analytical approach to the study of logic can seem at first sight pretty close to maths, as any enthusiastic literary-minded student will grumble after taking a course such as 'Introduction to Epistemology' where they were subjected to high-school math PTSD after wrangling with Bayes' rule and probabilistic characterizations of irrationality for a semester.
Starting with the similarities, logic will be very axiomatic in this kind of analytical philosophy as well, e.g. in epistemology they will extract 'axioms' of probability and basic rules of algebraic manipulation to study belief-updating. Additionally, both disciplines will subsume predicate logic, with varying levels of rigour in different bodies of work. But there are differences. First, Logic in analytical philosophy has historically been motivated as a way to refine thought. For instance, Stalnaker in Inquiry tries to pin down concepts of intentionality and counterfactuals in a self-consistent analytical system. In so doing he follows the same formula as mathematicians: he will use the tools and ansatzs of logic considered useful in analytical philosophy to make ontologically foreign concepts such as 'intentionality' consistent with the rest of the formulation. The difference is that philosophy (of any kind) usually needs to claim to be directly relevant to the human experience, not unwieldingly hidden behind layers and layers of abstraction as is often the case in maths.
Simplifying a bit, maths creates its own world and aims to explore every corner regardless of relevance with curiosity, whereas philosophy stubbornly tries to explain the nature of our world as we perceive it, and these are two very different endeavours.
That said, I do believe that there are times where the two disciplines find unlikely common grounds. A very interesting example is how one can cast Hegel's logic, along with Aufhebung and the like, into a Category Theory framework (see e.g. A. Prahauser, 2022), which is very mathematical. Or, like how Derrida's post-structuralism has ties to connectionists views of language in linguistics which has been mathematically formalized as presheaves in a certain co-occurrence category through Yoneda embeddings, essentially representing the same conception of meaning with different tools and vocabulary.
To end, I don't believe there is one form of logic that can be subjected to restrictive correspondence, neither in mathematics nor in philosophy. The two have different goals and live in quite different language games, and thus have pretty idiosyncratic implicit and explicit conceptions of logic. But I do believe that our intuitions about logic is regulated by our colloquial understanding of it, and that can create unlikely correspondences between otherwise convoluted and idiosyncratic constructions, a form of convergent evolution of ideas.