You might want to look into some of the Log4j config web interfaces out there. Whether you configured Log4j initially via properties or not, Log4j exposes its API to you. So, you can programmatically modify settings. See the third party utilities listed on Log4j download page...
http://logging.apache.org/log4j/docs/download.html


A couple that pop out there are Log4web and Logweb, though I am not endorsing either. Just pointing them out as possible options. There is also a basic configuration servlet in the log4j-sandbox you might try.


Jake

At 09:33 AM 4/6/2005 +0530, you wrote:
>Basically, I am using more than one appender. SMTP appender is only for
>critical messages. So in JSP or HTML (GUI) I am providing option that
>whether user is required these critical messages by mail or not. So if
>he selected mail option then he will receive mail otherwise not. But I
>am using log4j.properties file to set this option. So how this option I
>will change through program? or any other way to do this...?
>In a program I written as
>static Logger logger = Logger.getLogger(TestLog4J.class.getName());
>
>and directly using logger object as
>logger.log(XLevel.TRACE,"DB connection not done.");
>
>The log4j.properties file is as
>
>log4j.rootCategory=info,RB1,EMAIL
>
>#########################
>#File Appender
>#########################
>
>log4j.appender.RB1=org.apache.log4j.FileAppender
>log4j.appender.RB1.File=/tmp/log4j.log
>log4j.appender.RB1.MaxFileSize=10MB
>log4j.appender.RB1.MaxBackupIndex=15
>log4j.appender.RB1.layout=org.apache.log4j.PatternLayout
>log4j.appender.RB1.layout.ConversionPattern=[%d] [%c] [%-5p] - %m%n
>
>########################
># SMTP Appender
>#######################
>
>


>#log4j.rootCategory=TRACE#log.XLevel,EMAIL
>log4j.appender.EMAIL=org.apache.log4j.net.SMTPAppender
>log4j.appender.EMAIL.Threshold=TRACE#log.XLevel
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>log4j.appender.EMAIL.Subject=ALERT MESSAGE
>log4j.appender.EMAIL.SMTPHost=dns.extenprise.net
>log4j.appender.EMAIL.BufferSize=1000
>log4j.appender.EMAIL.layout=org.apache.log4j.PatternLayout
>log4j.appender.EMAIL.layout.ConversionPattern=%d %-5p %m%n
>
>
>On Tue, 2005-04-05 at 20:13, Bradley, Todd wrote:
>
>> Maybe I don't understand your question, but wouldn't it just be
>> something like this?
>>
>> mySMTPAppender.close();
>>
>>
>> Todd.
>>
>> > -----Original Message-----
>> > From: utpal [mailto:[EMAIL PROTECTED]
>> > Sent: Tuesday, April 05, 2005 6:25 AM
>> > To: log4j-user@logging.apache.org
>> > Subject: How to disable log4j option using GUI?
>> >
>> > Hi All,
>> > I am displaying the mailing(smtp) option for log4j in GUI. I
>> > have set the smtp appender in log4j.properties file. While
>> > run time(i.e. using
>> > GUI) how I can disable the smtp appender?
>> > What is the way to do this...?
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>


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



Reply via email to