If the log entries to the Event viewer are the same as to the other appenders you already use, you needn't declare a new logger, just a new appender and attach this appender to the existing logger.
BTW: plz dont's use old threads to start a new one. Some people read this newsgroup ordered by threads, and the searching in archives in the future will be more reliable. And strip unnecessary text out of your mail. See the bottom of the mail: it contains a lot of the same strings. Heri > -----Original Message----- > From: Elaine White [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 27, 2005 4:26 PM > To: Log4J Users List > Subject: NTEventLogAppender > > > I am trying to alter a configuration file that is currently logging > errors in our system to relevant log files. I want the errors > to also be > sent to Windows Event Viewer. This is the extra code that I > have added, > following the syntax of the code that is already there and working. > However my extra code is not working and is making some of the system > crash. I am very inexperienced with log4j and can't figure > out where I'm > going wrong! > > > log4j.logger.com.ccms.sgm=ERROR, EventViewer > log4j.appender.EventViewer=org.apache.log4j.nt.NTEventLogAppender > log4j.appender.EventViewer.source="SGMLogging" > log4j.appender.EventViewer.layout=org.apache.log4j.PatternLayout > log4j.appender.EventViewer.layout.ConversionPattern="%d{ISO8601}: [%t] > %C{1}, %p, %c: %m%n > > > > > -----Original Message----- > From: Philip Denno [mailto:[EMAIL PROTECTED] > Sent: 26 October 2005 18:07 > To: Log4J Users List > Subject: RE: WELCOME to [email protected] > > I have done something similar in my program although I avoid the > registry. Just provide some place in your UI where a list can be > presented and then when the new level is selected change the level of > the desired logger programmatically. > > Of course if you want this new level to persist across program > invocations then you would need to get a bit fancy and re-write the > property file on application exit. > > Cheers, > Philip. > > -----Original Message----- > From: Rakesh Patel [mailto:[EMAIL PROTECTED] > Sent: October 25, 2005 4:58 AM > To: Log4J Users List > Subject: RE: WELCOME to [email protected] > > > Hi Elaine, > > I believe the new preferences API in Java uses the registry on windows > (and a text file on Unix). It's the preferred way of storing > values in a > non-platfrom specific way.... > > Cheers > > Rakesh > > -----Original Message----- > From: Elaine White [mailto:[EMAIL PROTECTED] > Sent: 25 October 2005 12:12 > To: Log4J Users List > Subject: RE: WELCOME to [email protected] > > > Thank you. Where would I find out about reading registry > values out from > my program? Elaine > > -----Original Message----- > From: Bender Heri [mailto:[EMAIL PROTECTED] > Sent: 25 October 2005 12:12 > To: Log4J Users List > Subject: RE: WELCOME to [email protected] > > Elaine > > Log4j has nothing to do with registry. This is java world, that means > crossplattform world. Everything is configured by files and nothing by > windows registry. > > You can, of course, read registry values out from your program and > configure or reconfigure log4j by code. But that's up to you. > > Heri > > > -----Original Message----- > > From: Elaine White [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, October 25, 2005 12:45 PM > > To: [email protected] > > Subject: RE: WELCOME to [email protected] > > > > > > > > Hello, > > > > I am starting to learn how to use log4j and I have a problem that I > > can't seem to solve on my own. I have looked through lots > of on-line > > documents but cannot find the answer to my question. > > > > We have a number of log4j trace logging files that will need to be > > configured by sales engineers. The sales engineers need to > be able to > > change the level of logging but we don't want them editing > the config > > files. Is it possible to set it up so that the level can be set and > > changed in the registry editor rather than in the config file? > > > > Thank you for your help, > > Elaine > > > > > > > --------------------------------------------------------------------- > > 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] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > American Express Investments and American Express Independent > Financial > Advisers are marketing names for American Express Financial Services > Europe Limited, a separate corporation within the American > Express group > of companies. American Express Financial Services Europe Limited is > authorised and regulated by, and is entered into the register (No. > 190853 www.fsa.gov.uk/register/) of, the Financial Services Authority > and a member of the London Stock Exchange. Registered in England No. > 3614902. Registered address: 230 Blackfriars Road, London SE1 8NW. Vat > No. 740 4143 68. > > The information in this email and any attachments is confidential and > intended solely for the attention and use of the named > addressee(s). It > may be subject to legal, professional or other privilege and further > distribution of it is strictly prohibited without our > authority. If you > are not the intended recipient, you are not authorised to and must not > disclose, copy, distribute, or retain this message or any part of it, > and should notify us immediately. > > > --------------------------------------------------------------------- > 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] > > > > --------------------------------------------------------------------- > 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]
