* that you can move logic around as needed.
*/
public class ContextListener implements ServletContextListener {
-
-
- // Initialization, parsing files, and setting up
+
+ //TODO: Change before release
+ private static final Level defaultLogLevel = Level.DEBUG;
+
+ // Initialization, parsing files, and setting up
public static final String SHIBBOLETH_INIT = "shibboleth.init";
private static Logger initLogger = Logger.getLogger(SHIBBOLETH_INIT);
private static Logger initLogger2 = Logger.getLogger("edu.internet2.middleware.shibboleth.xml");
clientLogger.addAppender(threadAppender);
clientLogger.addAppender(consoleAppender);
- clientLogger.setLevel(Level.DEBUG);
+ clientLogger.setLevel(defaultLogLevel);
initLogger.addAppender(consoleAppender);
- initLogger.setLevel(Level.DEBUG);
+ initLogger.setLevel(defaultLogLevel);
- initLogger2.setLevel(Level.DEBUG);
+ initLogger2.setLevel(defaultLogLevel);
// The init log location is represented as a URL in the web.xml
// We have to change this int a fully qualified path name
samlLogger.addAppender(threadAppender);
samlLogger.addAppender(consoleAppender);
- samlLogger.setLevel(Level.DEBUG);
+ samlLogger.setLevel(defaultLogLevel);
serviceLogger.addAppender(consoleAppender);
- serviceLogger.setLevel(Level.DEBUG);
+ serviceLogger.setLevel(defaultLogLevel);
try {
* @author Howard Gilbert
*/
public class Parser {
+
+ // This class is used by both the Idp and SP, so it must use
+ // a conventionally declared logger. The SP has a special logger
+ // setup so this package also logs to the init log.
private static Logger log = Logger.getLogger(Parser.class);
public static Document loadDom(InputSource ins, boolean validate) throws SAMLException, SAXException, IOException {
Document doc = null;
- log.debug("Loading XML from (" + ins.getSystemId() + ")" + (validate ? " with Schema validation" : ""));
+ log.info("Loading XML from (" + ins.getSystemId() + ")" + (validate ? " with Schema validation" : ""));
if (validate) {
doc = org.opensaml.XML.parserPool.parse(ins, schema);
} else {
* @return A string containing the XML in character form.
*/
public static String jaxpSerialize(Node dom) {
- String ret = null;
-
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = null;
DOMSource source = new DOMSource(dom);
}
catch (InvalidCanonicalizerException e)
{
+ log.error("Error obtaining an XML canonicalizer ",e);
return null;
}
catch (CanonicalizationException e)
{
+ log.error("Error canonicalizing XML ",e);
return null;
}
return new String(bs);
InputSource insrc;
try {
InputStream resourceAsStream =
- // Parser.class.getResourceAsStream(configFilePath);
new ShibResource(configFilePath).getInputStream();
insrc = new InputSource(resourceAsStream);
insrc.setSystemId(configFilePath);
*/
public class SchemasDirectoryImpl extends SchemaStore {
+ // This class is used by both the Idp and SP, so it must use
+ // a conventionally declared logger. The SP has a special logger
+ // setup so this package also logs to the init log.
private static Logger log = Logger.getLogger(SchemasDirectoryImpl.class);
private String resourcedir = "/schemas/";
return false;
}
String[] filenames = dir.list();
- int nextsource=0;
for (int i=0;i<filenames.length;i++) {
String filename = filenames[i];
if (!filename.endsWith(".xsd"))
// Put the DOM in the Bucket keyed by namespace
if (bucket.containsKey(targetNamespace)) {
- log.debug("Replacing XSD for namespace: "+targetNamespace+" "+filename);
+ log.info("Replacing XSD for namespace: "+targetNamespace+" "+filename);
} else {
- log.debug("Defining XSD for namespace: "+targetNamespace+" "+filename);
+ log.info("Defining XSD for namespace: "+targetNamespace+" "+filename);
}
bucket.put(targetNamespace,xsddom);
}
*/
public class SchemasResourceListImpl extends SchemaStore {
+ // This class is used by both the Idp and SP, so it must use
+ // a conventionally declared logger. The SP has a special logger
+ // setup so this package also logs to the init log.
private static Logger log = Logger.getLogger(SchemasDirectoryImpl.class);
private String resourceprefix = "/schemas/";
private void loadBucket() {
- // for each .xsd file in the directory
- int nextsource=0;
for (int i=0;i<resourceNames.length;i++) {
String filename = resourceNames[i];
if (!filename.endsWith(".xsd")) {
// Put the DOM in the Bucket keyed by namespace
if (bucket.containsKey(targetNamespace)) {
- log.debug("Replacing XSD for namespace: "+targetNamespace+" "+filename);
+ log.info("Replacing XSD for namespace: "+targetNamespace+" "+filename);
} else {
- log.debug("Defining XSD for namespace: "+targetNamespace+" "+filename);
+ log.info("Defining XSD for namespace: "+targetNamespace+" "+filename);
}
bucket.put(targetNamespace,xsddom);
}