logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicko Cadell <ni...@Neoworks.com>
Subject RE: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi Logge rRepositoryEventListener.java LoggerEventListener.java
Date Wed, 13 Nov 2002 18:01:03 GMT
Would having a configurationChanged event have any impact on the
isConfigured() method that Ceki proposed adding to the LoggerRepository
interface? If the configurationChanged event is fired should isConfigured()
always return true or should it still work the way previously proposed?

The repository selector is tasked with returning the appropriate repository
for the caller. This means that it may create multiple repositories,
therefore it would be possible to add another listener interface to listen
for repositoryCreated events from the RepositorySelector implementation.

Nicko

> -----Original Message-----
> From: Mark Womack [mailto:mwomack@bevocal.com]
> Sent: 13 November 2002 17:51
> To: 'Log4J Developers List'
> Subject: RE: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi
> Logge rRepositoryEventListener.java LoggerEventListener.java
> 
> 
> Good point.  A startupEvent probably does not make sense, but 
> I think a
> configurationChanged event would make sense.  I would think that the
> configurator would force the repository to fire the 
> configurationChanged
> event, just as loggers force it to fire logger related events.
> 
> ?
> 
> -Mark
> 
> > -----Original Message-----
> > From: Nicko Cadell [mailto:nicko@Neoworks.com]
> > Sent: Wednesday, November 13, 2002 2:58 AM
> > To: 'Log4J Developers List'
> > Subject: RE: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi
> > Logge rRepositoryEventListener.java LoggerEventListener.java
> > 
> > 
> > Just a quick question about the LoggerRepositoryEventListener:
> > 
> > When will the LoggerRepositoryEventListener.startupEvent be fired?
> > 
> > If it is fired when the repository is created, then no 
> listeners will 
> > have been registered. 
> > 
> > Is this really a ConfiguredEvent fired after the repository 
> has been 
> > configured? If so who is responsible for triggering it? One of the 
> > Configurators or the repository itself?
> > 
> > Thanks,
> > Nicko
> > 
> > > -----Original Message-----
> > > From: mwomack@apache.org [mailto:mwomack@apache.org]
> > > Sent: 13 November 2002 05:53
> > > To: jakarta-log4j-cvs@apache.org
> > > Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi
> > > LoggerRepositoryEventListener.java LoggerEventListener.java
> > > 
> > > 
> > > mwomack     2002/11/12 21:52:39
> > > 
> > >   Added:       src/java/org/apache/log4j/spi
> > >                         LoggerRepositoryEventListener.java
> > >                         LoggerEventListener.java
> > >   Log:
> > >   Added.
> > >   
> > >   Revision  Changes    Path
> > >   1.1                  
> > > jakarta-log4j/src/java/org/apache/log4j/spi/LoggerRepositoryEv
> > > entListener.java
> > >   
> > >   Index: LoggerRepositoryEventListener.java
> > >   
> > ===================================================================
> > >   /*
> > >    * Copyright (C) The Apache Software Foundation. All rights 
> > > reserved.
> > >    *
> > >    * This software is published under the terms of the 
> > Apache Software
> > >    * License version 1.1, a copy of which has been included 
> > with this
> > >    * distribution in the LICENSE.txt file.  */
> > >   
> > >   package org.apache.log4j.spi;
> > >   
> > >   /**
> > >     Interface used to listen for {@link LoggerRepository} related
> > >     events such as startup, reset, and shutdown.  Clients register
> > >     an instance of the interface and the instance is called back
> > >     when the various events occur.
> > >     
> > >     {@link LoggerRepository} provides methods for adding 
> > and removing
> > >     LoggerEventListener instances.
> > >   
> > >     @author Ceki G&uuml;lc&uuml;
> > >     @author Mark Womack
> > >     @since 1.3
> > >   */
> > >   public interface LoggerRepositoryEventListener {
> > >     
> > >     /**
> > >       Called when the repository is started. */
> > >     public void startupEvent(LoggerRepository repository);
> > >   
> > >     /**
> > >       Called when the repository configuration is reset. */
> > >     public void configurationResetEvent(LoggerRepository 
> > repository);
> > >   
> > >     /**
> > >       Called when the repository is shutdown. When this method is
> > >       invoked, the repository is still valid (ie it has not been
> > >       shutdown, but will be after this method returns). */
> > >     public void shutdownEvent(LoggerRepository repository);
> > >   }
> > >   
> > >   
> > >   1.1                  
> > > 
> jakarta-log4j/src/java/org/apache/log4j/spi/LoggerEventListener.java
> > >   
> > >   Index: LoggerEventListener.java
> > >   
> > ===================================================================
> > >   /*
> > >    * Copyright (C) The Apache Software Foundation. All rights 
> > > reserved.
> > >    *
> > >    * This software is published under the terms of the 
> > Apache Software
> > >    * License version 1.1, a copy of which has been included 
> > with this
> > >    * distribution in the LICENSE.txt file.  */
> > >   
> > >   package org.apache.log4j.spi;
> > >   
> > >   import org.apache.log4j.Logger;
> > >   import org.apache.log4j.Appender;
> > >   
> > >   /**
> > >     Interface used to listen for {@link Logger} related 
> > events such as
> > >     add/remove appender or changing levels.  Clients register 
> > > an instance of
> > >     the interface and the instance is called back when the 
> > > various events occur.
> > >     
> > >     {@link LoggerRepository} provides methods for adding 
> > and removing
> > >     LoggerEventListener instances.
> > >     
> > >     When implementing the methods of this interface, it is 
> > > useful to remember
> > >     that the Logger can access the repository using its 
> > > getRepository()
> > >     method.
> > >     
> > >     @author Ceki G&uuml;lc&uuml;
> > >     @author Mark Womack
> > >     @since 1.3
> > >   */
> > >   public interface LoggerEventListener {
> > >     
> > >     /**
> > >       Called when an appender is added to the logger.
> > >       
> > >       @param logger The logger to which the appender was added.
> > >       @param appender The appender added to the logger. */
> > >     public void appenderAddedEvent(Logger logger, Appender 
> > appender);
> > >     
> > >     /**
> > >       Called when an appender is removed from the logger.
> > >       
> > >       @param logger The logger from which the appender 
> was removed.
> > >       @param appender The appender removed from the logger. */
> > >     public void appenderRemovedEvent(Logger logger, Appender 
> > > appender);
> > >   
> > >     /**
> > >       Called when all appenders are removed from the logger.
> > >       
> > >       @param logger The logger from which the appenders were 
> > > removed. */
> > >     public void allAppendersRemovedEvent(Logger logger);
> > >     
> > >     /**
> > >       Called when level changed on the logger.
> > >       
> > >       @param logger The logger that changed levels. */
> > >     public void levelChangedEvent(Logger logger);
> > >   }
> > >   
> > >   
> > > 
> > > --
> > > To unsubscribe, e-mail:   
> > > <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: 
> > > <mailto:log4j-dev-help@jakarta.apache.org>
> > > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
> > <mailto:log4j-dev-help@jakarta.apache.org>
> > 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:log4j-dev-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>


Mime
View raw message