From log4j-cvsanna24@example.org Wed Jul 03 21:53:48 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 26321 invoked from network); 3 Jul 2002 21:53:48 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Jul 2002 21:53:48 -0000 Received: (qmail 9693 invoked by uid 97); 3 Jul 2002 21:54:03 -0000 Delivered-To: anna24@example.org Received: (qmail 9642 invoked by uid 97); 3 Jul 2002 21:54:03 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 9628 invoked by uid 98); 3 Jul 2002 21:54:02 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 3 Jul 2002 21:53:48 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/bin - New directory X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bradm 2002/07/03 14:53:48 jakarta-log4j/bin - New directory -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Wed Jul 03 21:55:26 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 26603 invoked from network); 3 Jul 2002 21:55:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Jul 2002 21:55:25 -0000 Received: (qmail 9962 invoked by uid 97); 3 Jul 2002 21:55:41 -0000 Delivered-To: anna24@example.org Received: (qmail 9946 invoked by uid 97); 3 Jul 2002 21:55:40 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 9934 invoked by uid 98); 3 Jul 2002 21:55:40 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 3 Jul 2002 21:55:25 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/bin lcp.bat StartLogFactor5.sh StartLogFactor5Console.bat X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bradm 2002/07/03 14:55:25 Added: bin Tag: v1_2-branch lcp.bat StartLogFactor5.sh StartLogFactor5Console.bat Log: added bat and sh files to start up LogFactor5 GUI independent of a running application Revision Changes Path No revision No revision 83.161.120.155 +2 -0 jakarta-log4j/bin/Attic/lcp.bat 83.161.120.155 +20 -0 jakarta-log4j/bin/Attic/StartLogFactor5.sh 83.161.120.155 +24 -0 jakarta-log4j/bin/Attic/StartLogFactor5Console.bat -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Thu Jul 04 13:03:19 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 85566 invoked from network); 4 Jul 2002 13:03:18 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 4 Jul 2002 13:03:18 -0000 Received: (qmail 6363 invoked by uid 97); 4 Jul 2002 13:03:28 -0000 Delivered-To: anna24@example.org Received: (qmail 6317 invoked by uid 97); 4 Jul 2002 13:03:28 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 6304 invoked by uid 98); 4 Jul 2002 13:03:27 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 4 Jul 2002 13:03:13 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j AsyncAppender.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/04 06:03:13 Modified: src/java/org/apache/log4j Tag: v1_2-branch AsyncAppender.java Log: Indentation changes only. Revision Changes Path No revision No revision 83.161.120.155 +39 -57 jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java Index: AsyncAppender.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- AsyncAppender.java 11 Jun 2002 13:05:23 -0000 83.161.120.155 +++ AsyncAppender.java 4 Jul 2002 13:03:13 -0000 83.161.120.155 @@ -33,9 +33,7 @@ <p><b>Important note:</b> The <code>AsyncAppender</code> can only be script configured using the {@link - org.apache.log4j.xml.DOMConfigurator}. Refer to example configuration - files <a href="xml/examples/doc-files/sample4.xml">sample4.xml</a> - and <a href="xml/examples/doc-files/sample5.xml">sample5.xml</a>. + org.apache.log4j.xml.DOMConfigurator}. @author Ceki G&uuml;lc&uuml; @since 0.9.1 */ @@ -55,8 +53,7 @@ boolean interruptedWarningMessage = false; - public - AsyncAppender() { + public yncAppender() { // Note: The dispatcher code assumes that the aai is set once and // for all. aai = new AppenderAttachableImpl(); @@ -65,15 +62,13 @@ } - public - void addAppender(Appender newAppender) { + public void addAppender(Appender newAppender) { synchronized(aai) { aai.addAppender(newAppender); } } - public - void append(LoggingEvent event) { + public void append(LoggingEvent event) { // Set the NDC and thread name for the calling thread as these // LoggingEvent fields were not set at event creation time. event.getNDC(); @@ -112,8 +107,7 @@ dispatcher thread which will process all pending events before exiting. */ - public - void close() { + public void close() { synchronized(this) { // avoid multiple close, otherwise one gets NullPointerException if(closed) { @@ -137,15 +131,13 @@ bf = null; } - public - Enumeration getAllAppenders() { + public Enumeration getAllAppenders() { synchronized(aai) { return aai.getAllAppenders(); } } - public - Appender getAppender(String name) { + public Appender getAppender(String name) { synchronized(aai) { return aai.getAppender(name); } @@ -154,89 +146,80 @@ /** Returns the current value of the <b>LocationInfo</b> option. */ - public - boolean getLocationInfo() { + public boolean getLocationInfo() { return locationInfo; } /** Is the appender passed as parameter attached to this category? */ - public - boolean isAttached(Appender appender) { + public boolean isAttached(Appender appender) { return aai.isAttached(appender); } /** The <code>AsyncAppender</code> does not require a layout. Hence, - this method always returns <code>false</code>. */ - public - boolean requiresLayout() { + this method always returns <code>false</code>. + */ + public boolean requiresLayout() { return false; } - public - void removeAllAppenders() { + public void removeAllAppenders() { synchronized(aai) { aai.removeAllAppenders(); } } - public - void removeAppender(Appender appender) { + public void removeAppender(Appender appender) { synchronized(aai) { aai.removeAppender(appender); } } - public - void removeAppender(String name) { + public void removeAppender(String name) { synchronized(aai) { aai.removeAppender(name); } } /** - The <b>LocationInfo</b> option takes a boolean value. By - default, it is set to false which means there will be no effort - to extract the location information related to the event. As a - result, the event that will be ultimately logged will likely to - contain the wrong location information (if present in the log - format). - - <p>Location information extraction is comparatively very slow and - should be avoided unless performance is not a concern. - */ - public - void setLocationInfo(boolean flag) { + * The <b>LocationInfo</b> option takes a boolean value. By default, + * it is set to false which means there will be no effort to extract + * the location information related to the event. As a result, the + * event that will be ultimately logged will likely to contain the + * wrong location information (if present in the log format). + * + * <p>Location information extraction is comparatively very slow and + * should be avoided unless performance is not a concern. + * */ + public void setLocationInfo(boolean flag) { locationInfo = flag; } /** - The <b>BufferSize</b> option takes a non-negative integer - value. This integer value determines the maximum size of the - bounded buffer. Increasing the size of the buffer is always - safe. However, if an existing buffer holds unwritten elements, - then <em>decreasing the buffer size will result in event - loss.</em> Nevertheless, while script configuring the - AsyncAppender, it is safe to set a buffer size smaller than the - {@link #DEFAULT_BUFFER_SIZE default buffer size} because - configurators guarantee that an appender cannot be used before - being completely configured. - */ - public - void setBufferSize(int size) { + * The <b>BufferSize</b> option takes a non-negative integer value. + * This integer value determines the maximum size of the bounded + * buffer. Increasing the size of the buffer is always + * safe. However, if an existing buffer holds unwritten elements, + * then <em>decreasing the buffer size will result in event + * loss.</em> Nevertheless, while script configuring the + * AsyncAppender, it is safe to set a buffer size smaller than the + * {@link #DEFAULT_BUFFER_SIZE default buffer size} because + * configurators guarantee that an appender cannot be used before + * being completely configured. + * */ + public void setBufferSize(int size) { bf.resize(size); } /** Returns the current value of the <b>BufferSize</b> option. */ - public - int getBufferSize() { + public int getBufferSize() { return bf.getMaxSize(); } @@ -291,8 +274,7 @@ <p>Other approaches might yield better results. */ - public - void run() { + public void run() { //Category cat = Category.getInstance(Dispatcher.class.getName()); -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Fri Jul 05 08:44:27 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 5660 invoked from network); 5 Jul 2002 08:44:26 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Jul 2002 08:44:26 -0000 Received: (qmail 20524 invoked by uid 97); 5 Jul 2002 08:44:48 -0000 Delivered-To: anna24@example.org Received: (qmail 20470 invoked by uid 97); 5 Jul 2002 08:44:47 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 20457 invoked by uid 98); 5 Jul 2002 08:44:46 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 5 Jul 2002 08:44:21 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/tests/src/java/org/apache/log4j VectorAppender.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/05 01:44:20 Modified: tests/src/java/org/apache/log4j Tag: v1_2-branch VectorAppender.java Log: - Added the isClosed method. - Indentation changes. Revision Changes Path No revision No revision 83.161.120.155 +10 -12 jakarta-log4j/tests/src/java/org/apache/log4j/VectorAppender.java Index: VectorAppender.java =================================================================== RCS file: /home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/VectorAppender.java,v retrieving revision 1.1 retrieving revision 83.161.120.155 diff -u -r1.1 -r83.161.120.155 --- VectorAppender.java 9 May 2002 17:44:54 -0000 1.1 +++ VectorAppender.java 5 Jul 2002 08:44:20 -0000 83.161.120.155 @@ -24,16 +24,14 @@ public Vector vector; - public - VectorAppender() { + public VectorAppender() { vector = new Vector(); } /** Does nothing. */ - public - void activateOptions() { + public void activateOptions() { } @@ -42,19 +40,16 @@ method. */ - public - void append(LoggingEvent event) { + public void append(LoggingEvent event) { System.out.println("---Vector appender called with message ["+event.getRenderedMessage()+"]."); vector.addElement(event); } - public - Vector getVector() { + public Vector getVector() { return vector; } - public - synchronized + public synchronized void close() { if(this.closed) return; @@ -62,8 +57,11 @@ } - public - boolean requiresLayout() { + public boolean isClosed() { + return this.closed; + } + + public boolean requiresLayout() { return false; } } -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Fri Jul 05 11:08:24 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 21909 invoked from network); 5 Jul 2002 11:08:24 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Jul 2002 11:08:24 -0000 Received: (qmail 6919 invoked by uid 97); 5 Jul 2002 11:08:32 -0000 Delivered-To: anna24@example.org Received: (qmail 6891 invoked by uid 97); 5 Jul 2002 11:08:32 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 6872 invoked by uid 98); 5 Jul 2002 11:08:31 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 5 Jul 2002 11:08:19 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/net SocketAppender.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/05 04:08:19 Modified: src/java/org/apache/log4j/net Tag: v1_2-branch SocketAppender.java Log: Only cosmetic (indentation) changes to SocketAppender.java Revision Changes Path No revision No revision 83.161.120.155 +38 -58 jakarta-log4j/src/java/org/apache/log4j/net/SocketAppender.java Index: SocketAppender.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/net/SocketAppender.java,v retrieving revision 1.12 retrieving revision 83.161.120.155 diff -u -r1.12 -r83.161.120.155 --- SocketAppender.java 24 Apr 2002 01:16:12 -0000 1.12 +++ SocketAppender.java 5 Jul 2002 11:08:19 -0000 83.161.120.155 @@ -128,8 +128,7 @@ /** Connects to remote server at <code>address</code> and <code>port</code>. */ - public - SocketAppender(InetAddress address, int port) { + public SocketAppender(InetAddress address, int port) { this.address = address; this.remoteHost = address.getHostName(); this.port = port; @@ -139,8 +138,7 @@ /** Connects to remote server at <code>host</code> and <code>port</code>. */ - public - SocketAppender(String host, int port) { + public SocketAppender(String host, int port) { this.port = port; this.address = getAddressByName(host); this.remoteHost = host; @@ -150,19 +148,17 @@ /** Connect to the specified <b>RemoteHost</b> and <b>Port</b>. */ - public - void activateOptions() { + public void activateOptions() { connect(address, port); } /** - Close this appender. - <p>This will mark the appender as closed and - call then {@link #cleanUp} method. - */ - synchronized - public - void close() { + * Close this appender. + * + * <p>This will mark the appender as closed and call then {@link + * #cleanUp} method. + * */ + synchronized public void close() { if(closed) return; @@ -171,16 +167,14 @@ } /** - Drop the connection to the remote host and release the underlying - connector thread if it has been created - */ - public - void cleanUp() { + * Drop the connection to the remote host and release the underlying + * connector thread if it has been created + * */ + public void cleanUp() { if(oos != null) { try { oos.close(); - } - catch(IOException e) { + } catch(IOException e) { LogLog.error("Could not close oos.", e); } oos = null; @@ -199,8 +193,7 @@ // First, close the previous connection if any. cleanUp(); oos = new ObjectOutputStream(new Socket(address, port).getOutputStream()); - } - catch(IOException e) { + } catch(IOException e) { LogLog.error("Could not connect to remote log4j server at [" +address.getHostName()+"]. We will try again later.", e); fireConnector(); @@ -208,8 +201,7 @@ } - public - void append(LoggingEvent event) { + public void append(LoggingEvent event) { if(event == null) return; @@ -234,8 +226,7 @@ //System.err.println("Doing oos.reset()"); oos.reset(); } - } - catch(IOException e) { + } catch(IOException e) { oos = null; LogLog.warn("Detected problem with connection: "+e); if(reconnectionDelay > 0) { @@ -259,28 +250,26 @@ InetAddress getAddressByName(String host) { try { return InetAddress.getByName(host); - } - catch(Exception e) { + } catch(Exception e) { LogLog.error("Could not find address of ["+host+"].", e); return null; } } /** - The SocketAppender does not use a layout. Hence, this method returns - <code>false</code>. - */ - public - boolean requiresLayout() { + * The SocketAppender does not use a layout. Hence, this method + * returns <code>false</code>. + * */ + public boolean requiresLayout() { return false; } /** - The <b>RemoteHost</b> option takes a string value which should be - the host name of the server where a {@link SocketNode} is running. - */ - public - void setRemoteHost(String host) { + * The <b>RemoteHost</b> option takes a string value which should be + * the host name of the server where a {@link SocketNode} is + * running. + * */ + public void setRemoteHost(String host) { address = getAddressByName(host); remoteHost = host; } @@ -288,8 +277,7 @@ /** Returns value of the <b>RemoteHost</b> option. */ - public - String getRemoteHost() { + public String getRemoteHost() { return remoteHost; } @@ -297,16 +285,14 @@ The <b>Port</b> option takes a positive integer representing the port where the server is waiting for connections. */ - public - void setPort(int port) { + public void setPort(int port) { this.port = port; } /** Returns value of the <b>Port</b> option. */ - public - int getPort() { + public int getPort() { return port; } @@ -315,16 +301,14 @@ the information sent to the remote host will include location information. By default no location information is sent to the server. */ - public - void setLocationInfo(boolean locationInfo) { + public void setLocationInfo(boolean locationInfo) { this.locationInfo = locationInfo; } /** Returns value of the <b>LocationInfo</b> option. */ - public - boolean getLocationInfo() { + public boolean getLocationInfo() { return locationInfo; } @@ -337,16 +321,14 @@ <p>Setting this option to zero turns off reconnection capability. */ - public - void setReconnectionDelay(int delay) { + public void setReconnectionDelay(int delay) { this.reconnectionDelay = delay; } /** Returns value of the <b>ReconnectionDelay</b> option. */ - public - int getReconnectionDelay() { + public int getReconnectionDelay() { return reconnectionDelay; } @@ -377,18 +359,16 @@ synchronized(this) { oos = new ObjectOutputStream(socket.getOutputStream()); connector = null; + LogLog.debug("Connection established. Exiting connector thread."); break; } - } - catch(InterruptedException e) { + } catch(InterruptedException e) { LogLog.debug("Connector interrupted. Leaving loop."); return; - } - catch(java.net.ConnectException e) { + } catch(java.net.ConnectException e) { LogLog.debug("Remote host "+address.getHostName() +" refused connection."); - } - catch(IOException e) { + } catch(IOException e) { LogLog.debug("Could not connect to " + address.getHostName()+ ". Exception is " + e); } -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Fri Jul 05 11:11:56 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 23386 invoked from network); 5 Jul 2002 11:11:55 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Jul 2002 11:11:55 -0000 Received: (qmail 11557 invoked by uid 97); 5 Jul 2002 11:12:01 -0000 Delivered-To: anna24@example.org Received: (qmail 11392 invoked by uid 97); 5 Jul 2002 11:12:00 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 11183 invoked by uid 98); 5 Jul 2002 11:11:59 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 5 Jul 2002 11:11:43 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/tests/src/java/org/apache/log4j AsyncAppenderTestCase.java VectorAppender.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/05 04:11:43 Modified: src/java/org/apache/log4j Tag: v1_2-branch AsyncAppender.java tests/src/java/org/apache/log4j Tag: v1_2-branch AsyncAppenderTestCase.java VectorAppender.java Log: - AyncAppener now closes its embedded appenders when AsyncAppender.close() is called. - New test cases in AsyncAppenderTestCase.java Revision Changes Path No revision No revision 83.161.120.155 +5 -2 jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java Index: AsyncAppender.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/AsyncAppender.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- AsyncAppender.java 4 Jul 2002 13:03:13 -0000 83.161.120.155 +++ AsyncAppender.java 5 Jul 2002 11:11:42 -0000 83.161.120.155 @@ -53,7 +53,7 @@ boolean interruptedWarningMessage = false; - public yncAppender() { + public AsyncAppender() { // Note: The dispatcher code assumes that the aai is set once and // for all. aai = new AppenderAttachableImpl(); @@ -286,7 +286,7 @@ // Exit loop if interrupted but only if the the buffer is empty. if(interrupted) { //cat.info("Exiting."); - return; + break; } try { //LogLog.debug("Waiting for new event to dispatch."); @@ -311,5 +311,8 @@ } } } // while + + // close and remove all appenders + aai.removeAllAppenders(); } } No revision No revision 83.161.120.155 +51 -1 jakarta-log4j/tests/src/java/org/apache/log4j/AsyncAppenderTestCase.java Index: AsyncAppenderTestCase.java =================================================================== RCS file: /home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/AsyncAppenderTestCase.java,v retrieving revision 1.1 retrieving revision 83.161.120.155 diff -u -r1.1 -r83.161.120.155 --- AsyncAppenderTestCase.java 9 May 2002 17:44:54 -0000 1.1 +++ AsyncAppenderTestCase.java 5 Jul 2002 11:11:43 -0000 83.161.120.155 @@ -28,14 +28,17 @@ public void setUp() { } - public void tearDown() { + public void tearDown() { + LogManager.shutdown(); } + // this test checks whether it is possible to write to a closed AsyncAppender public void closeTest() throws Exception { Logger root = Logger.getRootLogger(); Layout layout = new SimpleLayout(); VectorAppender vectorAppender = new VectorAppender(); AsyncAppender asyncAppender = new AsyncAppender(); + asyncAppender.setName("async-CloseTest"); asyncAppender.addAppender(vectorAppender); root.addAppender(asyncAppender); @@ -45,13 +48,60 @@ Vector v = vectorAppender.getVector(); assertEquals(v.size(), 1); + } + + // this test checks whether appenders embedded within an AsyncAppender are also + // closed + public void test2() { + Logger root = Logger.getRootLogger(); + Layout layout = new SimpleLayout(); + VectorAppender vectorAppender = new VectorAppender(); + AsyncAppender asyncAppender = new AsyncAppender(); + asyncAppender.setName("async-test2"); + asyncAppender.addAppender(vectorAppender); + root.addAppender(asyncAppender); + + root.debug("m1"); + asyncAppender.close(); + root.debug("m2"); + Vector v = vectorAppender.getVector(); + assertEquals(v.size(), 1); + assertTrue(vectorAppender.isClosed()); + } + + // this test checks whether appenders embedded within an AsyncAppender are also + // closed + public void test3() { + int LEN = 200; + Logger root = Logger.getRootLogger(); + Layout layout = new SimpleLayout(); + VectorAppender vectorAppender = new VectorAppender(); + AsyncAppender asyncAppender = new AsyncAppender(); + asyncAppender.setName("async-test3"); + asyncAppender.addAppender(vectorAppender); + root.addAppender(asyncAppender); + for(int i = 0; i < LEN; i++) { + root.debug("message"+i); + } + + System.out.println("Done loop."); + System.out.flush(); + asyncAppender.close(); + root.debug("m2"); + + Vector v = vectorAppender.getVector(); + assertEquals(v.size(), LEN); + assertTrue(vectorAppender.isClosed()); } + public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new AsyncAppenderTestCase("closeTest")); + suite.addTest(new AsyncAppenderTestCase("test2")); + suite.addTest(new AsyncAppenderTestCase("test3")); return suite; } 83.161.120.155 +7 -3 jakarta-log4j/tests/src/java/org/apache/log4j/VectorAppender.java Index: VectorAppender.java =================================================================== RCS file: /home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/VectorAppender.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- VectorAppender.java 5 Jul 2002 08:44:20 -0000 83.161.120.155 +++ VectorAppender.java 5 Jul 2002 11:11:43 -0000 83.161.120.155 @@ -42,6 +42,11 @@ */ public void append(LoggingEvent event) { System.out.println("---Vector appender called with message ["+event.getRenderedMessage()+"]."); + System.out.flush(); + try { + Thread.currentThread().sleep(100); + } catch(Exception e) { + } vector.addElement(event); } @@ -49,8 +54,7 @@ return vector; } - public synchronized - void close() { + public synchronized void close() { if(this.closed) return; this.closed = true; @@ -58,7 +62,7 @@ public boolean isClosed() { - return this.closed; + return closed; } public boolean requiresLayout() { -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Fri Jul 05 11:22:34 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 29827 invoked from network); 5 Jul 2002 11:22:33 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Jul 2002 11:22:33 -0000 Received: (qmail 16982 invoked by uid 97); 5 Jul 2002 11:22:42 -0000 Delivered-To: anna24@example.org Received: (qmail 16966 invoked by uid 97); 5 Jul 2002 11:22:42 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 16954 invoked by uid 98); 5 Jul 2002 11:22:41 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 5 Jul 2002 11:22:29 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/helpers AppenderAttachableImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/05 04:22:29 Modified: src/java/org/apache/log4j/helpers Tag: v1_2-branch AppenderAttachableImpl.java Log: Minor documentation changes. Revision Changes Path No revision No revision 83.161.120.155 +2 -2 jakarta-log4j/src/java/org/apache/log4j/helpers/AppenderAttachableImpl.java Index: AppenderAttachableImpl.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/helpers/AppenderAttachableImpl.java,v retrieving revision 1.6 retrieving revision 83.161.120.155 diff -u -r1.6 -r83.161.120.155 --- AppenderAttachableImpl.java 17 Nov 2001 01:04:22 -0000 1.6 +++ AppenderAttachableImpl.java 5 Jul 2002 11:22:29 -0000 83.161.120.155 @@ -121,8 +121,8 @@ /** - Remove all previously attached appenders. - */ + * Remove and close all previously attached appenders. + * */ public void removeAllAppenders() { if(appenderList != null) { -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Fri Jul 05 11:23:54 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 30353 invoked from network); 5 Jul 2002 11:23:54 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Jul 2002 11:23:54 -0000 Received: (qmail 17347 invoked by uid 97); 5 Jul 2002 11:24:03 -0000 Delivered-To: anna24@example.org Received: (qmail 17309 invoked by uid 97); 5 Jul 2002 11:24:02 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 17297 invoked by uid 98); 5 Jul 2002 11:24:02 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 5 Jul 2002 11:23:50 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/xdocs documentation.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/05 04:23:50 Modified: docs Tag: v1_2-branch HISTORY src/xdocs Tag: v1_2-branch documentation.xml Log: - Added link to log4j book - Updated the history file Revision Changes Path No revision No revision 83.161.120.155 +10 -0 jakarta-log4j/docs/HISTORY Index: HISTORY =================================================================== RCS file: /home/cvs/jakarta-log4j/docs/HISTORY,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- HISTORY 19 Jun 2002 10:01:03 -0000 83.161.120.155 +++ HISTORY 5 Jul 2002 11:23:49 -0000 83.161.120.155 @@ -5,6 +5,16 @@ client code. [***] Changes requiring important modifications to existing client code. + July 5th, 2002, + + - Release of version 1.2.5 + + - Minor changes and bug fixes in LF5. [*] + + - Calling an AsyncAppender close method also closes the embedded + appender instances. This resolves bug #10185 submitted by Paul + Voutier. [*] + June 12th, 2002, - Release of version 1.2.4 No revision No revision 83.161.120.155 +6 -0 jakarta-log4j/src/xdocs/documentation.xml Index: documentation.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/src/xdocs/documentation.xml,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- documentation.xml 12 Jun 2002 21:31:35 -0000 83.161.120.155 +++ documentation.xml 5 Jul 2002 11:23:49 -0000 83.161.120.155 @@ -15,7 +15,13 @@ <ul> <p> + <a href="http://www.flashline.com/components/view.jsp?prodid=4702&amp;affiliateid=657173"><img align="right" src="images/coverSmall.png"></img></a> <li><a href="manual.html"><b>short manual</b></a>, + </li> + </p> + + <p> + <li><a href="http://www.flashline.com/components/view.jsp?prodid=4702&amp;affiliateid=657173"><b>complete manual</b></a> (commercial), </li> </p> -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Sun Jul 07 06:45:53 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 41716 invoked from network); 7 Jul 2002 06:45:52 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 7 Jul 2002 06:45:52 -0000 Received: (qmail 1512 invoked by uid 97); 7 Jul 2002 06:46:14 -0000 Delivered-To: anna24@example.org Received: (qmail 1461 invoked by uid 97); 7 Jul 2002 06:46:12 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 1447 invoked by uid 98); 7 Jul 2002 06:46:12 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 7 Jul 2002 06:45:47 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j MDC.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mwomack 2002/07/06 23:45:47 Modified: src/java/org/apache/log4j Tag: v1_2-branch MDC.java Log: Fix for bug #10528. Hashtable does not support null value for key (unlike HashMap), so check for null key value before getting value. Revision Changes Path No revision No revision 83.161.120.155 +6 -6 jakarta-log4j/src/java/org/apache/log4j/MDC.java Index: MDC.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/MDC.java,v retrieving revision 1.10 retrieving revision 83.161.120.155 diff -u -r1.10 -r83.161.120.155 --- MDC.java 21 Oct 2001 14:06:44 -0000 1.10 +++ MDC.java 7 Jul 2002 06:45:46 -0000 83.161.120.155 @@ -104,8 +104,8 @@ } else { Hashtable ht = (Hashtable) ((ThreadLocalMap)tlm).get(); if(ht == null) { - ht = new Hashtable(HT_SIZE); - ((ThreadLocalMap)tlm).set(ht); + ht = new Hashtable(HT_SIZE); + ((ThreadLocalMap)tlm).set(ht); } ht.put(key, o); } @@ -117,10 +117,10 @@ return null; } else { Hashtable ht = (Hashtable) ((ThreadLocalMap)tlm).get(); - if(ht != null) { - return ht.get(key); + if(ht != null && key != null) { + return ht.get(key); } else { - return null; + return null; } } } @@ -130,7 +130,7 @@ if(!java1) { Hashtable ht = (Hashtable) ((ThreadLocalMap)tlm).get(); if(ht != null) { - ht.remove(key); + ht.remove(key); } } } -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Sun Jul 07 06:47:12 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 41980 invoked from network); 7 Jul 2002 06:47:11 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 7 Jul 2002 06:47:11 -0000 Received: (qmail 2048 invoked by uid 97); 7 Jul 2002 06:47:32 -0000 Delivered-To: anna24@example.org Received: (qmail 2032 invoked by uid 97); 7 Jul 2002 06:47:32 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 2020 invoked by uid 98); 7 Jul 2002 06:47:31 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 7 Jul 2002 06:47:06 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/tests/witness PatternParser_mdc X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mwomack 2002/07/06 23:47:06 Added: tests/witness Tag: v1_2-branch PatternParser_mdc Log: PatternParserTestCase which tests mdc conversion pattern. Tests fix for bug #10528. Revision Changes Path No revision No revision 83.161.120.155 +12 -0 jakarta-log4j/tests/witness/Attic/PatternParser_mdc -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Sun Jul 07 06:47:26 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 42049 invoked from network); 7 Jul 2002 06:47:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 7 Jul 2002 06:47:25 -0000 Received: (qmail 2221 invoked by uid 97); 7 Jul 2002 06:47:46 -0000 Delivered-To: anna24@example.org Received: (qmail 2202 invoked by uid 97); 7 Jul 2002 06:47:46 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 2190 invoked by uid 98); 7 Jul 2002 06:47:45 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 7 Jul 2002 06:47:20 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/tests/src/java/org/apache/log4j/helpers PatternParserTestCase.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mwomack 2002/07/06 23:47:20 Added: tests/src/java/org/apache/log4j/helpers Tag: v1_2-branch PatternParserTestCase.java Log: PatternParserTestCase which tests mdc conversion pattern. Tests fix for bug #10528. Revision Changes Path No revision No revision 83.161.120.155 +121 -0 jakarta-log4j/tests/src/java/org/apache/log4j/helpers/Attic/PatternParserTestCase.java -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Sun Jul 07 06:47:49 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 42136 invoked from network); 7 Jul 2002 06:47:48 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 7 Jul 2002 06:47:48 -0000 Received: (qmail 2385 invoked by uid 97); 7 Jul 2002 06:48:09 -0000 Delivered-To: anna24@example.org Received: (qmail 2369 invoked by uid 97); 7 Jul 2002 06:48:09 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 2357 invoked by uid 98); 7 Jul 2002 06:48:08 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 7 Jul 2002 06:47:43 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/tests build.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mwomack 2002/07/06 23:47:43 Modified: tests Tag: v1_2-branch build.xml Log: PatternParserTestCase which tests mdc conversion pattern. Tests fix for bug #10528. Revision Changes Path No revision No revision 83.161.120.155 +10 -2 jakarta-log4j/tests/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- build.xml 11 Jun 2002 13:21:59 -0000 83.161.120.155 +++ build.xml 7 Jul 2002 06:47:43 -0000 83.161.120.155 @@ -99,8 +99,8 @@ HierarchyThreshold, SocketServer, XMLLayout, AsyncAppender, OptionConverter, BoundedFIFO, - CyclicBuffer, OR, LevelMatchFilter, - DRFA"/> + CyclicBuffer, PatternParser, OR, + LevelMatchFilter, DRFA"/> <!-- ================================================================= --> <!-- Longer unit tests --> @@ -239,6 +239,14 @@ <classpath refid="tests.classpath"/> <formatter type="plain" usefile="false"/> <test name="org.apache.log4j.helpers.CyclicBufferTestCase" /> + </junit> + </target> + + <target name="PatternParser" depends="build"> + <junit printsummary="yes" fork="yes" haltonfailure="yes"> + <classpath refid="tests.classpath"/> + <formatter type="plain" usefile="false"/> + <test name="org.apache.log4j.helpers.PatternParserTestCase" /> </junit> </target> -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Thu Jul 11 08:51:33 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 51943 invoked from network); 11 Jul 2002 08:51:32 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 11 Jul 2002 08:51:32 -0000 Received: (qmail 20796 invoked by uid 97); 11 Jul 2002 08:51:57 -0000 Delivered-To: anna24@example.org Received: (qmail 20748 invoked by uid 97); 11 Jul 2002 08:51:56 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 20735 invoked by uid 98); 11 Jul 2002 08:51:56 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 11 Jul 2002 08:51:26 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/tests/src/java/org/apache/log4j VectorAppender.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/11 01:51:26 Modified: src/xdocs Tag: v1_2-branch download.xml tests/src/java/org/apache/log4j Tag: v1_2-branch VectorAppender.java Log: Minor changes that were not committed when 1.2.5 was released. - Change of refenreces to 1.2.5 instead of 1.2.4 in src/xdocs/download.xml - Minor change in tests/src/java/org/apache/log4j/VectorAppender.java Revision Changes Path No revision No revision 83.161.120.155 +6 -6 jakarta-log4j/src/xdocs/download.xml Index: download.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/src/xdocs/download.xml,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- download.xml 12 Jun 2002 13:55:34 -0000 83.161.120.155 +++ download.xml 11 Jul 2002 08:51:26 -0000 83.161.120.155 @@ -9,15 +9,15 @@ <meta name="keywords" content="java, logging, tracing, component, framework, API, log4j"/> <body> - <section name="log4j version 1.2.4"> - <p>log4j 1.2.4 is available in <a - href="../jakarta-log4j-1.2.4.tar.gz"><b>TAR.GZ</b></a> format - or in <a href="../jakarta-log4j-1.2.4.zip"><b>ZIP</b></a> + <section name="log4j version 1.2.5"> + <p>log4j 1.2.5 is available in <a + href="../jakarta-log4j-1.2.5.tar.gz"><b>TAR.GZ</b></a> format + or in <a href="../jakarta-log4j-1.2.5.zip"><b>ZIP</b></a> format. </p> - <p>Release 1.2.4 fixes several relatively minor bugs. See the - <a href="HISTORY">HISTORY</a> file for the exact details. + <p>Release 1.2.5 fixes minor bugs. See the <a + href="HISTORY">HISTORY</a> file for the exact details. </p> <p>In addition to many performance improvements, bug fixes, and No revision No revision 83.161.120.155 +2 -2 jakarta-log4j/tests/src/java/org/apache/log4j/VectorAppender.java Index: VectorAppender.java =================================================================== RCS file: /home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/VectorAppender.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- VectorAppender.java 5 Jul 2002 11:11:43 -0000 83.161.120.155 +++ VectorAppender.java 11 Jul 2002 08:51:26 -0000 83.161.120.155 @@ -41,8 +41,8 @@ */ public void append(LoggingEvent event) { - System.out.println("---Vector appender called with message ["+event.getRenderedMessage()+"]."); - System.out.flush(); + //System.out.println("---Vector appender called with message ["+event.getRenderedMessage()+"]."); + //System.out.flush(); try { Thread.currentThread().sleep(100); } catch(Exception e) { -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Thu Jul 11 08:56:01 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 56030 invoked from network); 11 Jul 2002 08:56:00 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 11 Jul 2002 08:56:00 -0000 Received: (qmail 28632 invoked by uid 97); 11 Jul 2002 08:56:25 -0000 Delivered-To: anna24@example.org Received: (qmail 28606 invoked by uid 97); 11 Jul 2002 08:56:25 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 28593 invoked by uid 98); 11 Jul 2002 08:56:24 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 11 Jul 2002 08:55:55 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/xdocs download.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/11 01:55:55 Modified: src/xdocs Tag: v1_2-branch download.xml Log: New reference to Log888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Log4Perl log4j port in src/xdocs/download.xml Revision Changes Path No revision No revision 83.161.120.155 +12 -2 jakarta-log4j/src/xdocs/download.xml Index: download.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/src/xdocs/download.xml,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- download.xml 11 Jul 2002 08:51:26 -0000 83.161.120.155 +++ download.xml 11 Jul 2002 08:55:55 -0000 83.161.120.155 @@ -203,14 +203,24 @@ </dd> <!-- =========================================================================== --> - + <dt><a + href="http://log4perl.sourceforge.net"><b>Log888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Log4perl</b></a></dt> + + <dd>Log888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Log4perl is a Perl port of log4j by Kevin Goess and + Mike Schilli. The authors made sure that their port was as + close as possible to the original implementation. Even the + configuration files are similar! The project is still being + enhanced, however the current release is stable and has been + released to CPAN. + </dd> + <!-- =========================================================================== --> <dt><a href="http://www.neoworks.com/products/log4net/"><b>log4net</b></a></dt> <dd>The .NET implementation of the popular log4j Java API providing flexible and arbitrarily granular control over log management and configuration.</dd> - + <!-- =========================================================================== --> <dt><a href="http://www.its4you.at/log4py.php"><b>log4py</b></a></dt> -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Thu Jul 11 09:12:28 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 66595 invoked from network); 11 Jul 2002 09:12:28 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 11 Jul 2002 09:12:28 -0000 Received: (qmail 9862 invoked by uid 97); 11 Jul 2002 09:12:53 -0000 Delivered-To: anna24@example.org Received: (qmail 9807 invoked by uid 97); 11 Jul 2002 09:12:52 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 9795 invoked by uid 98); 11 Jul 2002 09:12:52 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 11 Jul 2002 09:12:22 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/src/xdocs download.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ceki 2002/07/11 02:12:22 Modified: src/xdocs Tag: v1_2-branch download.xml Log: Small change to the text in src/xdocs/download.xml Revision Changes Path No revision No revision 83.161.120.155 +1 -1 jakarta-log4j/src/xdocs/download.xml Index: download.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/src/xdocs/download.xml,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- download.xml 11 Jul 2002 08:55:55 -0000 83.161.120.155 +++ download.xml 11 Jul 2002 09:12:22 -0000 83.161.120.155 @@ -47,7 +47,7 @@ <p>We also maintain a list of <a href="earlier.html">earlier versions</a> of log4j for download, intended for the curious - paleontologist. + paleontologist -- there seems to be thousands of them! </p> -- To unsubscribe, e-mail: <mailto:anna24@example.org> For additional commands, e-mail: <mailto:anna24@example.org> From log4j-cvsanna24@example.org Fri Jul 12 18:39:20 2002 Return-Path: <log4j-cvsanna24@example.org> Delivered-To: anna24@example.org Received: (qmail 72215 invoked from network); 12 Jul 2002 18:39:19 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 12 Jul 2002 18:39:19 -0000 Received: (qmail 471 invoked by uid 97); 12 Jul 2002 18:39:36 -0000 Delivered-To: anna24@example.org Received: (qmail 411 invoked by uid 97); 12 Jul 2002 18:39:35 -0000 Mailing-List: contact anna24@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:anna24@example.org> List-Subscribe: <mailto:anna24@example.org> List-Help: <mailto:anna24@example.org> List-Post: <mailto:anna24@example.org> List-Id: "Log4J CVS List" <log4j-cvs.jakarta.apache.org> Reply-To: "Log4J Developers List" <anna24@example.org> Delivered-To: mailing list anna24@example.org Received: (qmail 399 invoked by uid 98); 12 Jul 2002 18:39:34 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 12 Jul 2002 18:39:13 -0000 Message-ID: <anna24@example.org> From: anna24@example.org To: anna24@example.org Subject: cvs commit: jakarta-log4j/examples/lf5/UsingSocketAppenders UsingSocketAppenders.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bradm 2002/07/12 11:39:13 Modified: examples/lf5/UsingLogMonitorAdapter Tag: v1_2-branch CustomizedLogLevels.java UsingLogMonitorAdapter.java examples/lf5/InitUsingDefaultConfigurator Tag: v1_2-branch InitUsingDefaultConfigurator.java examples/lf5/InitUsingLog4JProperties Tag: v1_2-branch InitUsingLog4JProperties.java examples/lf5/InitUsingMultipleAppenders Tag: v1_2-branch InitUsingMultipleAppenders.java examples/lf5/InitUsingPropertiesFile Tag: v1_2-branch InitUsingPropertiesFile.java examples/lf5/InitUsingXMLPropertiesFile Tag: v1_2-branch InitUsingXMLPropertiesFile.java examples/lf5/UsingSocketAppenders Tag: v1_2-branch UsingSocketAppenders.java Log: changed examples to work with Logger rather than Category Revision Changes Path No revision No revision 83.161.120.155 +68 -69 jakarta-log4j/examples/lf5/UsingLogMonitorAdapter/Attic/CustomizedLogLevels.java Index: CustomizedLogLevels.java =================================================================== RCS file: /home/cvs/jakarta-log4j/examples/lf5/UsingLogMonitorAdapter/Attic/CustomizedLogLevels.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- CustomizedLogLevels.java 12 Jun 2002 21:06:28 -0000 83.161.120.155 +++ CustomizedLogLevels.java 12 Jul 2002 18:39:12 -0000 83.161.120.155 @@ -9,7 +9,6 @@ package examples.lf5.UsingLogMonitorAdapter; import org.apache.log4j.lf5.LogLevel; -import org.apache.log4j.lf5.util.AdapterLogRecord; import org.apache.log4j.lf5.util.LogMonitorAdapter; /** @@ -26,74 +25,74 @@ // Contributed by ThoughtWorks Inc. public class CustomizedLogLevels { - //-------------------------------------------------------------------------- - // Constants: - //-------------------------------------------------------------------------- - public final static LogLevel LEVEL_ONE = new LogLevel("LEVEL 1", 1); - public final static LogLevel LEVEL_TWO = new LogLevel("LEVEL 2", 2); - public final static LogLevel LEVEL_THREE = new LogLevel("LEVEL 3", 3); - public final static LogLevel LEVEL_FOUR = new LogLevel("LEVEL 4", 4); - public final static LogLevel DEFAULT = new LogLevel("DEFAULT", 0); - - //-------------------------------------------------------------------------- - // Protected Variables: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Private Variables: - //-------------------------------------------------------------------------- - private static LogMonitorAdapter _adapter; - - static { - // The first LogLevel in the Array will be used as the default LogLevel. - _adapter = LogMonitorAdapter.newInstance(new LogLevel[]{DEFAULT, LEVEL_ONE, - LEVEL_TWO, LEVEL_THREE, LEVEL_FOUR, LogLevel.FATAL}); - // if a different log level is to be used it can be specified as such - // _adapter.setDefaultLevel(LEVEL_THREE); - } - //-------------------------------------------------------------------------- - // Constructors: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Public Methods: - //-------------------------------------------------------------------------- - - public static void main(String[] args) { - CustomizedLogLevels test = new CustomizedLogLevels(); - test.doMyBidding(); - } - - public void doMyBidding() { - // tell the LogMonitorAdapter which LogLevel is the severe Level if necessary - _adapter.setSevereLevel(LEVEL_ONE); - - String levels = this.getClass().getName(); - - // will used the default Level - _adapter.log(levels, "Using the customized LogLevels"); - - _adapter.log(levels, LEVEL_FOUR, "This is a test"); - _adapter.log(levels, LEVEL_THREE, "Hmmm fobidden doughnut"); - _adapter.log(levels, LEVEL_ONE, "Danger Danger Will Robinson", - new RuntimeException("DANGER"), "32"); - _adapter.log(levels, LEVEL_TWO, "Exit stage right->"); - _adapter.log(levels, LEVEL_FOUR, "What's up Doc?", - new NullPointerException("Unfortunate exception")); - - } - - //-------------------------------------------------------------------------- - // Protected Methods: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Private Methods: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Nested Top-Level Classes or Interfaces: - //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // Constants: + //-------------------------------------------------------------------------- + public final static LogLevel LEVEL_ONE = new LogLevel("LEVEL 1", 1); + public final static LogLevel LEVEL_TWO = new LogLevel("LEVEL 2", 2); + public final static LogLevel LEVEL_THREE = new LogLevel("LEVEL 3", 3); + public final static LogLevel LEVEL_FOUR = new LogLevel("LEVEL 4", 4); + public final static LogLevel DEFAULT = new LogLevel("DEFAULT", 0); + + //-------------------------------------------------------------------------- + // Protected Variables: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Private Variables: + //-------------------------------------------------------------------------- + private static LogMonitorAdapter _adapter; + + static { + // The first LogLevel in the Array will be used as the default LogLevel. + _adapter = LogMonitorAdapter.newInstance(new LogLevel[]{DEFAULT, LEVEL_ONE, + LEVEL_TWO, LEVEL_THREE, LEVEL_FOUR, LogLevel.FATAL}); + // if a different log level is to be used it can be specified as such + // _adapter.setDefaultLevel(LEVEL_THREE); + } + //-------------------------------------------------------------------------- + // Constructors: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Public Methods: + //-------------------------------------------------------------------------- + + public static void main(String[] args) { + CustomizedLogLevels test = new CustomizedLogLevels(); + test.doMyBidding(); + } + + public void doMyBidding() { + // tell the LogMonitorAdapter which LogLevel is the severe Level if necessary + _adapter.setSevereLevel(LEVEL_ONE); + + String levels = this.getClass().getName(); + + // will used the default Level + _adapter.log(levels, "Using the customized LogLevels"); + + _adapter.log(levels, LEVEL_FOUR, "This is a test"); + _adapter.log(levels, LEVEL_THREE, "Hmmm fobidden doughnut"); + _adapter.log(levels, LEVEL_ONE, "Danger Danger Will Robinson", + new RuntimeException("DANGER"), "32"); + _adapter.log(levels, LEVEL_TWO, "Exit stage right->"); + _adapter.log(levels, LEVEL_FOUR, "What's up Doc?", + new NullPointerException("Unfortunate exception")); + + } + + //-------------------------------------------------------------------------- + // Protected Methods: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Private Methods: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Nested Top-Level Classes or Interfaces: + //-------------------------------------------------------------------------- } 83.161.120.155 +6 -6 jakarta-log4j/examples/lf5/UsingLogMonitorAdapter/Attic/UsingLogMonitorAdapter.java Index: UsingLogMonitorAdapter.java =================================================================== RCS file: /home/cvs/jakarta-log4j/examples/lf5/UsingLogMonitorAdapter/Attic/UsingLogMonitorAdapter.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- UsingLogMonitorAdapter.java 12 Jun 2002 21:06:28 -0000 83.161.120.155 +++ UsingLogMonitorAdapter.java 12 Jul 2002 18:39:12 -0000 83.161.120.155 @@ -54,16 +54,16 @@ } public void doMyBidding() { - String category = this.getClass().getName(); + String logger = this.getClass().getName(); // will default to debug log level - _adapter.log(category, "Doh this is a debugging"); + _adapter.log(logger, "Doh this is a debugging"); - _adapter.log(category, LogLevel.INFO, "Hmmm fobidden doughnut"); - _adapter.log(category, LogLevel.WARN, "Danger Danger Will Robinson", + _adapter.log(logger, LogLevel.INFO, "Hmmm fobidden doughnut"); + _adapter.log(logger, LogLevel.WARN, "Danger Danger Will Robinson", new RuntimeException("DANGER"), "32"); - _adapter.log(category, LogLevel.ERROR, "Exit stage right->"); - _adapter.log(category, LogLevel.FATAL, "What's up Doc?", + _adapter.log(logger, LogLevel.ERROR, "Exit stage right->"); + _adapter.log(logger, LogLevel.FATAL, "What's up Doc?", new NullPointerException("Unfortunate exception")); } No revision No revision 83.161.120.155 +91 -96 jakarta-log4j/examples/lf5/InitUsingDefaultConfigurator/Attic/InitUsingDefaultConfigurator.java Index: InitUsingDefaultConfigurator.java =================================================================== RCS file: /home/cvs/jakarta-log4j/examples/lf5/InitUsingDefaultConfigurator/Attic/InitUsingDefaultConfigurator.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- InitUsingDefaultConfigurator.java 12 Jun 2002 21:06:27 -0000 83.161.120.155 +++ InitUsingDefaultConfigurator.java 12 Jul 2002 18:39:12 -0000 83.161.120.155 @@ -7,11 +7,9 @@ */ package examples.lf5.InitUsingDefaultConfigurator; -import org.apache.log4j.lf5.DefaultLF5Configurator; -import org.apache.log4j.lf5.LogLevel; -import org.apache.log4j.lf5.util.LogMonitorAdapter; -import org.apache.log4j.Category; +import org.apache.log4j.Logger; import org.apache.log4j.NDC; +import org.apache.log4j.lf5.DefaultLF5Configurator; import java.io.IOException; @@ -20,109 +18,106 @@ * logging window using the DefaultLF5Configurator. * * The DefaultLF5Configurator uses a default configuration file stored - * in the lf5.jar in order to provide a default configuration for + * in the log4j.jar in order to provide a default configuration for * the LF5Appender. * - * To make this example work, ensure that the lf5.jar and lf5-license.jar - * files are in your classpath, and then run the example at the command line. - * * @author Brent Sprecher */ // Contributed by ThoughtWorks Inc. public class InitUsingDefaultConfigurator { - //-------------------------------------------------------------------------- - // Constants: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Protected Variables: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Private Variables: - //-------------------------------------------------------------------------- - private static Category cat = - Category.getInstance(InitUsingDefaultConfigurator.class); - - //-------------------------------------------------------------------------- - // Constructors: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Public Methods: - //-------------------------------------------------------------------------- - - public static void main(String[] args) throws IOException { - // Configure the LF5Appender using the DefaultLF5Configurator. This - // will add the LF5Appender to the root of the Category tree. - DefaultLF5Configurator.configure(); - - // Add an NDC to demonstrate how NDC information is output. - NDC.push("#23856"); - // Log some information. - for (int i = 0; i < 10; i++) { - cat.debug("Hello, my name is Homer Simpson."); - cat.info("Mmmmmm .... Chocolate."); - cat.warn("Mmm...forbidden donut."); + //-------------------------------------------------------------------------- + // Constants: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Protected Variables: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Private Variables: + //-------------------------------------------------------------------------- + private static Logger logger = + Logger.getLogger(InitUsingDefaultConfigurator.class); + + //-------------------------------------------------------------------------- + // Constructors: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Public Methods: + //-------------------------------------------------------------------------- + + public static void main(String[] args) throws IOException { + // Configure the LF5Appender using the DefaultLF5Configurator. This + // will add the LF5Appender to the root of the Category tree. + DefaultLF5Configurator.configure(); + + // Add an NDC to demonstrate how NDC information is output. + NDC.push("#23856"); + // Log some information. + for (int i = 0; i < 10; i++) { + logger.debug("Hello, my name is Homer Simpson."); + logger.info("Mmmmmm .... Chocolate."); + logger.warn("Mmm...forbidden donut."); + } + // Clean up NDC + NDC.pop(); + NDC.remove(); + + NDC.push("Another NDC"); + // Log some information. + logger.fatal("Hello, my name is Bart Simpson."); + logger.error("Hi diddly ho good neighbour."); + // Clean up NDC + NDC.pop(); + NDC.remove(); + + // Call methods on both classes. + InitUsingDefaultConfigurator.foo(); + InnerInitUsingDefaultConfigurator.foo(); + + logger.info("Exiting InitUsingDefaultConfigurator."); + } - // Clean up NDC - NDC.pop(); - NDC.remove(); - - NDC.push("Another NDC"); - // Log some information. - cat.fatal("Hello, my name is Bart Simpson."); - cat.error("Hi diddly ho good neighbour."); - // Clean up NDC - NDC.pop(); - NDC.remove(); - - // Call methods on both classes. - InitUsingDefaultConfigurator.foo(); - InnerInitUsingDefaultConfigurator.foo(); - - cat.info("Exiting InitUsingDefaultConfigurator."); - - } - - public static void foo() { - cat.debug("Entered foo in InitUsingDefaultConfigurator class"); - - NDC.push("#123456"); - cat.debug("Hello, my name is Marge Simpson."); - cat.info("D'oh!! A deer! A female deer."); - // Clean up NDC - NDC.pop(); - NDC.remove(); - } - - //-------------------------------------------------------------------------- - // Protected Methods: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Private Methods: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Nested Top-Level Classes or Interfaces: - //-------------------------------------------------------------------------- - - public static class InnerInitUsingDefaultConfigurator { - static Category cat = - Category.getInstance(InnerInitUsingDefaultConfigurator.class.getName()); - - static void foo() throws IOException { - // Configure the LF5Appender again. You can call - // DefaultLF5Configurator.configure() as often as you want - // without unexpected behavior. - DefaultLF5Configurator.configure(); - cat.info("Entered foo in InnerInitUsingDefaultConfigurator class."); + public static void foo() { + logger.debug("Entered foo in InitUsingDefaultConfigurator class"); + + NDC.push("#123456"); + logger.debug("Hello, my name is Marge Simpson."); + logger.info("D'oh!! A deer! A female deer."); + // Clean up NDC + NDC.pop(); + NDC.remove(); + } + + //-------------------------------------------------------------------------- + // Protected Methods: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Private Methods: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Nested Top-Level Classes or Interfaces: + //-------------------------------------------------------------------------- + + public static class InnerInitUsingDefaultConfigurator { + static Logger logger = + Logger.getLogger(InnerInitUsingDefaultConfigurator.class.getName()); + + static void foo() throws IOException { + // Configure the LF5Appender again. You can call + // DefaultLF5Configurator.configure() as often as you want + // without unexpected behavior. + DefaultLF5Configurator.configure(); + + logger.info("Entered foo in InnerInitUsingDefaultConfigurator class."); + } } - } } No revision No revision 83.161.120.155 +76 -77 jakarta-log4j/examples/lf5/InitUsingLog4JProperties/Attic/InitUsingLog4JProperties.java Index: InitUsingLog4JProperties.java =================================================================== RCS file: /home/cvs/jakarta-log4j/examples/lf5/InitUsingLog4JProperties/Attic/InitUsingLog4JProperties.java,v retrieving revision 83.161.120.155 retrieving revision 83.161.120.155 diff -u -r83.161.120.155 -r83.161.120.155 --- InitUsingLog4JProperties.java 12 Jun 2002 21:06:27 -0000 83.161.120.155 +++ InitUsingLog4JProperties.java 12 Jul 2002 18:39:12 -0000 83.161.120.155 @@ -7,7 +7,7 @@ */ package examples.lf5.InitUsingLog4JProperties; -import org.apache.log4j.Category; +import org.apache.log4j.Logger; import java.io.IOException; @@ -26,10 +26,9 @@ * will load the file during class initialization. The LF5Appender will be * added to the root category of the Category tree. * - * To make this example work, ensure that the lf5.jar and lf5-license.jar - * files are in your classpath. Next, create a log4j.properties file and - * add this line to it, or add this line to your existing log4j.properties - * file. Run the example at the command line and explore the results! + * Create a log4j.properties file and add this line to it, or add this line + * to your existing log4j.properties file. Run the example at the command line + * and explore the results! * * @author Brent Sprecher */ @@ -37,77 +36,77 @@ // Contributed by ThoughtWorks Inc. public class InitUsingLog4JProperties { - //-------------------------------------------------------------------------- - // Constants: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Protected Variables: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Private Variables: - //-------------------------------------------------------------------------- - - private static Category cat = - Category.getInstance(InitUsingLog4JProperties.class); - - //-------------------------------------------------------------------------- - // Constructors: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Public Methods: - //-------------------------------------------------------------------------- - - public static void main(String argv[]) { - // Add a bunch of logging statements ... - cat.debug("Hello, my name is Homer Simpson."); - cat.debug("Hello, my name is Lisa Simpson."); - cat.debug("Hello, my name is Marge Simpson."); - cat.debug("Hello, my name is Bart Simpson."); - cat.debug("Hello, my name is Maggie Simpson."); - - cat.info("We are the Simpsons!"); - cat.info("Mmmmmm .... Chocolate."); - cat.info("Homer likes chocolate"); - cat.info("Doh!"); - cat.info("We are the Simpsons!"); - - cat.warn("Bart: I am through with working! Working is for chumps!" + - "Homer: Son, I'm proud of you. I was twice your age before " + - "I figured that out."); - cat.warn("Mmm...forbidden donut."); - cat.warn("D'oh! A deer! A female deer!"); - cat.warn("Truly, yours is a butt that won't quit." + - "- Bart, writing as Woodrow to Ms. Krabappel."); - - cat.error("Dear Baby, Welcome to Dumpsville. Population: you."); - cat.error("Dear Baby, Welcome to Dumpsville. Population: you.", - new IOException("Dumpsville, USA")); - cat.error("Mr. Hutz, are you aware you're not wearing pants?"); - cat.error("Mr. Hutz, are you aware you're not wearing pants?", - new IllegalStateException("Error !!")); - - - cat.fatal("Eep."); - cat.fatal("Mmm...forbidden donut.", - new SecurityException("Fatal Exception")); - cat.fatal("D'oh! A deer! A female deer!"); - cat.fatal("Mmmmmm .... Chocolate.", - new SecurityException("Fatal Exception")); - } - - //-------------------------------------------------------------------------- - // Protected Methods: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Private Methods: - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Nested Top-Level Classes or Interfaces: - //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // Constants: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Protected Variables: + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Private Variables: + //-------------------------------------------------------------------------- + + private static Logger logger = + Logger.getLogger(InitUsingLog4JProperties.class); +
{'source': 'Apache Software Foundation Public Mail Archives'}