log4j-sandbox, org.apache.log4j.net.IMAppender Modify IMAppender class to support comma-seperated 'recipient' field in the log4j properties file to allow for broadcast/multiple recipients. -dhartford, 4/13/05 /* * Copyright 1999,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.util.StringTokenizer; ..... protected void sendBuffer() { ..... if (chatroom) { groupchat.sendMessage(buf.toString()); } else { //DRH 4/13/05 change in favor of recipient list. //chat.sendMessage(buf.toString()); psuedoBroadcast(buf.toString()); } } catch (Exception e) { errorHandler.error( "Could not send message in IMAppender [" + name + "]", e, ErrorCode.GENERIC_FAILURE); } } /** * This method breaks up a comma-seperated recipient list * to allow for psuedo-broadcasting. */ private void psuedoBroadcast(String bufferedmessage) throws XMPPException{ StringTokenizer st = new StringTokenizer(recipient, ","); while (st.hasMoreTokens()) { chat = con.createChat(st.nextToken()); chat.sendMessage(bufferedmessage); } } //=====end snippet=====
Could you please do us a favour and attach the patch as an actual attachment text file/patch attachment? This makes applying them much easier (patch text can get mangled otherwise). cheers, Paul