This paper argues the possibility of designing AI that can learn logics from data. We provide an abstract framework for learning logics. In this framework, an agent A provides training examples that consist of formulas S and their logical consequences T. Then a machine M builds an axiomatic system that underlies between S and T. Alternatively, in the absence of an agent A, the machine M seeks an unknown logic underlying given data. We next provide two cases of learning logics: the first case considers learning deductive inference rules in propositional logic, and the second case considers learning transition rules in cellular automata. Each case study uses machine learning techniques together with metalogic programming.