Turning on Flying Saucer java.util.logging Output
Asked Answered
S

1

5

I'm compiling a PDF using iText and Flying Saucer, and unfortunately, I can't seem to get any output from Flying Saucer when compiling. I'd really like to be able to see what's going on internally so as to be able to debug the current problem I'm facing.

How can I turn on java.util.logging for Flying Saucer? I'm currently using SLF4J/Logback.

Suber answered 15/3, 2012 at 22:30 Comment(0)
S
11

Found it:

System.getProperties().setProperty("xr.util-logging.loggingEnabled", "true");
XRLog.setLoggingEnabled(true);
Suber answered 15/3, 2012 at 22:34 Comment(3)
How does this work with your SLF4j/Logback setup? XRLog uses JDKXRLogger logger by default which is JDK logging unfortunately.Jordanjordana
@Jordanjordana When using SLF4j/Logback you can use System.getProperties().setProperty("xr.util-logging.handlers", "org.slf4j.bridge.SLF4JBridgeHandler"); (or run your application with -Dxr.util-logging.loggingEnabled=true -Dxr.util-logging.handlers=org.slf4j.bridge.SLF4JBridgeHandler). See slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html or slf4j.org/legacy.html#log4j-over-slf4j Also see github.com/flyingsaucerproject/flyingsaucer/blob/master/… for info about xr.util-logging.handlersBoardman
Looks like only the first line is needed? I got the logging to work with only that one. (Although I was not using the PDF generation but using the Swing component, and without dedicated logging library)Malcolmmalcom

© 2022 - 2024 — McMap. All rights reserved.