  This paper consists of two parts. In the first part we show that in odd
dimension, as well as in even dimension below the critical weight (i.e. half
the dimension), the logarithmic singularities of Schwartz kernels and Green
kernels of conformal invariant pseudodifferential operators are linear
combinations of Weyl conformal invariants, i.e., of local conformal invariants
arising from complete tensorial contractions of the covariant derivatives of
the Lorentz ambient metric of Fefferman-Graham. In even dimension and above the
critical weight exceptional local conformal invariants may further come into
play. As a consequence, this allows us to get invariant expressions for the
logarithmic singularities of the Green kernels of the GJMS operators (including
the Yamabe and Paneitz operators). In the second part, we prove analogues of
these results in CR geometry. Namely, we prove that the logarithmic
singularities of Schwartz kernels and Green kernels of CR invariant Heisenberg
pseudodifferential operators give rise to local CR invariants, and below the
critical weight are linear combinations of complete tensorial contractions of
the covariant derivatives of Fefferman's K\"alher-Lorentz ambient metric. As a
consequence, we can obtain invariant descriptions of the logarithmic
singularities of the Green kernels of the CR GJMS operators of Gover-Graham
(including the CR Yamabe operator of Jerison-Lee).
