java.lang.Object
se.swedenconnect.opensaml.common.utils.SamlLog

public class SamlLog extends Object
Utilities for logging SAML messages.
Author:
Martin Lindström (martin@idsec.se)
  • Method Details

    • toString

      public static <T extends org.opensaml.core.xml.XMLObject> String toString(T object) throws org.opensaml.core.xml.io.MarshallingException
      Returns the given SAML object in its "pretty print" XML string form.
      Type Parameters:
      T - the type of object to "print"
      Parameters:
      object - the object to display as a string
      Returns:
      the XML as a string
      Throws:
      org.opensaml.core.xml.io.MarshallingException - for marshalling errors
    • toStringSafe

      public static <T extends org.opensaml.core.xml.XMLObject> String toStringSafe(T object)
      The same as Object.toString() but the method never throws (returns the empty string instead). Useful for logging statements.
      Type Parameters:
      T - the type of object to "print"
      Parameters:
      object - the object to display as a string
      Returns:
      the XML as a string