[corrected a typo]
Logic is understanding and coming up with arguments, given agreed upon modes of reasoning.
Argument:
"It rains. Also, if it rains it follows I'm wet. Therefore, I'm wet."
The mode of reasoning behind this arugment is what's called Modus Ponens:
"If a proposition hold and if from that proposition another follows, then this second proposition holds"
en.wikipedia.org/wiki/Modus_ponens
Argument:
"If I never met Obama, he couldn't know my name. If I met Obama, he wouldn't rember my name anyway. Either I met Obama or I didn't, but in both cases he wouldn't know my name. Thus, Obama doesn't know my name."
This uses the Law of Excluded Middle:
"A proposition is either true, or it's negation is true."
en.wikipedia.org/wiki/Law_of_excluded_middle
-----
Mathematical Logic is a formalization of that - you translate sentence to symbols and then you can effectively come up with arguments by manipulating the symbols according to agreed upon rules.
(in the follwing, the words forall, implies, and, or and not are usually represented by some symbols)
Modus ponens (second order logic):
forall P. forall Q. (P and (P implies Q)) implies Q
L. of E. M.:
forall P. P or not(P)
Another classical rule would be (example)
"if it's not the case that I'm both tall and pretty, then at least one is the case: I'm not tall or I'm not pretty."
In formal/mathematical logic
forall P. forall Q. not(P and Q) implies not(P) or not (Q)
Another classical rule would be (example)
"If from my being rich follows I have a gf, then if I have no gf, it means I can't be rich"
In formal/mathematical logic
forall P. forall Q. (P implies Q) implies (not(P) implies not(Q))
You can do math with the symbols, teach them to computers and so on.
All the above rules are takes as valid in
en.wikipedia.org/wiki/Classical_logic
A logic that, for example, drops the Law of Excluded Middle is
en.wikipedia.org/wiki/Intuitionistic_logic
Here is a logic with what's called modalities
en.wikipedia.org/wiki/Modal_logic
Here more stuff
en.wikipedia.org/wiki/Formal_system
You may chose a logic and add axioms about things other than proposition (e.g. sets, lines, number,...), and the formal frameworks you obtain this way are called rigorous mathematics.
-----
Philosophy of logic (or Mathematics) is, one may say, thinking about the reality of all the different things we can do. People fight about logics like they fight about politics.
Philosophy of Language is what happened when Russel and Wittgenstein sort of failed their project of putting human reasoning on a formal level - the project that arguably worked for mathematics.