> For example, with SMTPAppender, only a few static fields 
> remain, meaning
> that most of the configuration has to be done programmatically e.g.
> SMTPAppender mail = new SMTPAppender();
> mail.setFrom("[EMAIL PROTECTED]");
> mail.setTo("[EMAIL PROTECTED]");
> mail.setSMTPHost("Notes.gateway");
> mail.setSubject("Hello World");
> mail.activateOptions();
> 
> 
> Can anyone advise whether I am right in thinking this, or 
> whether I have got the wrong end of the stick.

I think you might have got the wrong impression. There's lots to
log4j, and it's easy to miss something that you end up needing later.

We use the DOMConfigurator which takes an XML document and uses
it to initialise log4j. There's a utility somewhere inside log4j
that can start a thread and check for changes in your XML config
file, then reconfigure the system when appropriate.

When we started using log4j this "auto update" component didn't
quite work properly and so we wrote our own (a simple thread to
check the last modified timestamp on a file every 10 seconds).
I daresay someone will let you know that it's been fixed in the
latest log4j.

Hope this gives you some ideas -- and the XML bigot in me thinks
that the DOMConfigurator is the way forward anyhow! ;-)

Cheers,
Mike.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to