We investigate weighted automata and their relationship to weighted logics. For this, we present syntax and semantics of a quantitative logic; the semantics counts ‘how often’ a formula is true in a given word. Our main result (jointly with Paul Gastin), extending classical results of Büchi, Elgot and Trakhtenbrot (1961), shows that if the weights are taken from an arbitrary semiring, then weighted automata and a syntactically defined fragment of our weighted logic are expressively equivalent. A corresponding result holds for infinite words. Moreover, this extends to quantitative automata investigated by Henzinger et al. with (non-semiring) average-type behaviors, or with discounting or limit average objectives for infinite words. Finally, recall that by fundamental results of Schützenberger and McNaughton-Papert from the 1970s, the classes of first-order definable and aperiodic languages coincide. Very recently, this equivalence could be extended to weighted first order logic and weighed aperiodic automata.