From 980520d8c2968dd78024303030f9eb156d7288b6 Mon Sep 17 00:00:00 2001 From: icrnjak <32704201+icrnjak@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:01:28 +0100 Subject: [PATCH] Set lower log level when loading an XML resource (#4) We are generating PDFs which include many external SVG files using ``. Following two log lines are repeated for **every** loaded SVG, which in our case results with more than 5000 uninformative log messages per PDF: ``` 2024-01-28T16:39:26.411+01:00 INFO 11121 --- [nio-8080-exec-7] com.openhtmltopdf.load : SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser 2024-01-28T16:39:26.411+01:00 INFO 11121 --- [nio-8080-exec-7] com.openhtmltopdf.load : Loaded document in ~0ms ``` I believe log level can be lowered from INFO to FINEST since these messages can be quite invasive. LMKWYT :eyes: --- .../src/main/java/com/openhtmltopdf/resource/XMLResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/XMLResource.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/XMLResource.java index cf1e0cc83..55ee4cc99 100644 --- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/XMLResource.java +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/resource/XMLResource.java @@ -118,7 +118,7 @@ public static final XMLReader newXMLReader() { "property, which is set to: " + System.getProperty("javax.xml.parsers.SAXParserFactory")); } - XRLog.log(Level.INFO, LogMessageId.LogMessageId1Param.LOAD_SAX_XMLREADER_IN_USE, xmlReader.getClass().getName()); + XRLog.log(Level.FINEST, LogMessageId.LogMessageId1Param.LOAD_SAX_XMLREADER_IN_USE, xmlReader.getClass().getName()); return xmlReader; } @@ -274,7 +274,7 @@ private XMLResource createXMLResource(XMLResource target) { target.setElapsedLoadTime(end - st); - XRLog.log(Level.INFO, LogMessageId.LogMessageId1Param.LOAD_LOADED_DOCUMENT_TIME, target.getElapsedLoadTime()); + XRLog.log(Level.FINEST, LogMessageId.LogMessageId1Param.LOAD_LOADED_DOCUMENT_TIME, target.getElapsedLoadTime()); target.setDocument((Document) output.getNode()); return target;