I could have sworn this question has been asked on this site before, but I can't find it, so:
There is no single definition of "logic" out there; there are a variety of competing notions with various levels of utility. Sometimes a logic is thought of purely as a way of relating sentences to each other (this is the usual stance in algebraic logic); other times, a logic is thought of as a way of describing and distinguishing structures of some pre-defined type (and here we land in abstract model theory - see also HallaSurvivor's comment above). These reflect your two bulletpoints respectively. Often additional niceness properties are required, and sometimes we mix both aspects (or more) at the "ground floor."
To get started, I'd focus on learning a little bit about each of these two basic approaches on its own, and then picking one to dive into more; after one specific notion of logic is well-understood it's much easier to pick up more. In my opinion, the best sources here are the first couple chapters of Blok/Pigozzi's Algebraizable Logics and the last bit of Ebbinghaus/Flum/Thomas's Mathematical Logic. I can't resist also mentioning Humberstone's The Connectives and the collection Model-Theoretic Logics. But I wouldn't use either as a starting point (I also wouldn't put them both in the same backpack).