Why and how is logic related to set theory? I am learning set theory on my own at the moment, and I realised I can't avoid not to learn logics. There is a strong connection between these two. such that,  proofs for sets are based on logics. 
I don't understand why and how these two fields are connected. For me, I reviewed them as separated fields. and from my past experience, one field is kind of self-contained, like axioms of Euclidean geometry are contained in geometry. axioms of real analysis are contained in real numbers.
With my limited knowledge about logic, It is based on statements, and a statement is either true or false. The rules of negations, contradictions etc completely make sense within the logic land!
However, in set theory. Objects are undefined, whatever objects which meet some conditions become sets. Sometimes we know what objects are, maybe even the exact and complete list of objects. Most of time we don’t. 
Therefore, How can we apply logic rules to a set of undefined objects? (did I miss something very important here?)
Hence I am not convinced that 'if the rule is true in logic, then it is also true for sets'? for example, let A,B,C be sets, $if A \subseteq B, and B \subseteq C, then A \subseteq C$, due to Transitive Inference.   
Many thanks! 
 A: There are several meanings to "logic", and it is not completely clear to me what the question means.
If it means "first-order logic", then the obvious relationship is that set theory is formalized in first-order logic, while set theory is used to formalize first-order logic as well. 
There is a different connection, historically, between set theory and logic.  Both went through a period of fast growth between (broadly) 1850 and 1950. During this period, the paradoxes of informal logic and informal set theory we discovered or rediscovered, and a lot of effort was devoted to finding ways to avoid the paradoxes and develop general foundations for mathematics.    
The paradoxes are one reason why set theory seems to focus more on logic than other fields - it takes much more work to run into paradoxes when studying basic real analysis than when studying basic set theory.  This is a general pattern with the fields that are broadly known as "mathematical logic" - they have more focus on formal languages and definability than most other areas of mathematics. 
However, as the question notes, after the period of quick growth, several of the areas known as "logic" began to grow apart as they matured to a point where it is difficult to do top-level research in all of the areas. In particular, set theory and model theory are currently quite different each other and from some other areas of logic. It would be very possible today for a researcher to say that they study set theory but don't "study logic". 
Of course this requires a particular kind of definition of what it means to "study logic", which leans more towards proof theory.  But this separation between fields can contribute toward a sense that, apart from some basic logical tools at the beginning, it is not necessary to "study logic" in order to study set theory. 
A: There is a very close relation between a predicate $P(x)$ and the set $\{x: P(x)\}$ of all $x$ (in some universe) for which this predicate is true.  The basic operations (not, and, or) of logic then correspond to the operations (complement, intersection, union) of set theory.
