Thanks a lot. 1.So the constructor with parameter is not used at all? 2. Then that requires I call DOMConfigurator.configureAndWatch(..) in the code, not for using -D option 3. Well, the timestamp I need is far before the logging happens. I need to do the process first, the process maybe takes long, and then log the process result, where the time is the process time.
Thanks --- Kevin Steppe <[EMAIL PROTECTED]> wrote: > > > Hu wrote: > > > Hi, I am new to log4j. I have some basic questions > > about log4j. > > 1. In what kind of situation the constructor of > > appenders that takes parameter will be called? if > I > > have my own appender that added more params, > should I > > creat the corresponding constructor? > > > > Since the configurator classes use the setXXX/getXXX > methods, supply those and > don't worry about the extra constructors. > > > > > 2. I use xml configuration file and use -D option > to > > specify the file, should it auto reload when the > > confiration file changed? I can't get it work. > > > > you need to use a 'configureAndWatch' method. Look > in the javadoc for the > config class. > Note that the configure and watch architecture is > changing for log4j 1.2 > > > > > 3. The message in LoggingEvent is private access, > for > > my situation, I need to put the timestamp in the > > message and in the appender I need to access the > > message to get the timestamp to create the file. > And > > remove the timestamp when the actual logging > happens. > > So is there any way to modify the message itself? > > > > The LoggingEvents automaticly get a timestamp > attached. Use a pattern layout > object to pull that out, it's much less work than > what you suggest. > > Kevin > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>