OK, reading that page you linked now.  Isn't JUL what I had set up within
the LoggingObject before the recent changes?

>Those log messages are handled by whatever logging configuration
you've specified. If you just want to manually review the logs
afterwards, then the normal logging mechanisms should be all you need.
If instead you want to be able to programmatically act on some

I guess I need to know how to make my application specify a logging
configuration.  When I deploy a .Net DLL compiled from the PDFBox JAR via
IKVM, I do not have very much control over the client's environment.  But I
still need to be able to record the information in some persistent manner
(e.g. file on disk, DB, Windows Event log, etc.).  Because my customer calls
up and says "your program did X" and I need my program to capture some
information about errors the library throws as it may give me clues about
why my program did X.

I also find that, when running the regression tests, just letting JUnit
capture all the logged stuff and dump it to stdout is not very helpful.  It
does give me an on-screen clue that there may have been problems, but then I
have to re-run it, redirecting stdout to a text file as 2000 lines of stuff
dumped to the console is rather useless.

Hopefully understanding why I even care about the logging will help when I
have follow-up questions.  For now I will assume your answer puts me on the
right track and attempt to pursue it.

Thanks.

Daniel

On Mon, Sep 14, 2009 at 5:08 AM, Jukka Zitting <[email protected]>wrote:

> Hi,
>
> On Sat, Sep 12, 2009 at 2:26 AM, Daniel Wilson
> <[email protected]> wrote:
> > First, how do I make this SimpleLog write a log file?
>
> You don't. SimpleLog is included in Commons Logging only as a last
> resort when no other logging mechanism is available. Normally you
> always use Commons Logging with some logging mechanism like Log4J or
> the standard java.util.logging (JUL). The added value of using Commons
> Logging is that the downstream user gets to choose which logging
> mechanism they want to use.
>
> The easiest solution when you start from scratch is probably to use
> JUL. See [1] for instructions.
>
> > 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?
>
> Those log messages are handled by whatever logging configuration
> you've specified. If you just want to manually review the logs
> afterwards, then the normal logging mechanisms should be all you need.
> If instead you want to be able to programmatically act on some
> internal error conditions in PDFBox, then it might be better to
> explicitly expose that information via some PDFBox API.
>
> [1] http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html
>
> BR,
>
> Jukka Zitting
>

Reply via email to