I'm trying to get some logging to a file into
org.apache.pdfbox.util.TestPDFToImage.java .

I've read http://commons.apache.org/logging/guide.html and
http://wiki.apache.org/commons/Logging/FrequentlyAskedQuestions and
http://commons.apache.org/logging/apidocs/org/apache/commons/logging/impl/SimpleLog.html.
 But I'm finding precious little information that actually tells how
to do
any logging.

All I want to do is get that test routine logging to a file so I can see
what exceptions we're encountering.  The test routine is an application that
uses the library, so actually setting up the logging framework to which
commons logging will log seems to be in order.

First, how do I make this SimpleLog write a log file?

I have

    import org.apache.commons.logging.impl.SimpleLog;
then within the class:
    private org.apache.commons.logging.impl.SimpleLog SL = null;
then within the constructor:
        SL = new
org.apache.commons.logging.impl.SimpleLog("TestPDFToImage.log");

SL.setLevel(org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ALL);
then within DoTestFile:
        SL.debug("\nPreparing to convert " + file.getName());

But I don't ever get a TestPDFToImage.log file created.


Second, the PDFBox library contains many log.error (or similar) calls.

How do I get my application's logging to capture and record those ... so
that I can actually see what those exceptions or other messages are and do
something about them?

Thanks!

Daniel

Reply via email to