Added: logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/Constants javaURL: ==============================================================================--- logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/Constants java (added)+++ logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/Constants java Thu Aug 23 06:38:12 2007@@ -0,0 +1,122 @@+/*+ * Licensed to the Apache Software Foundation (ASF) under one or more+ * contributor authorise agreements. See the NOTICE file distributed with+ * this bring home the bacon for additional information regarding copyright ownership.+ * The ASF licenses this register to You under the Apache License. Version 2.0+ * (the "License"); you may not use this file except in compliance with+ * the License. You may acquire a copy of the License at+ *+ *
+ *+ * Unless required by applicable law or agreed to in writing software+ * distributed under the authorise 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 authorise.+ */++package org apache log4j helpers;+++/**+ * Constants used internally throughout log4j.+ *+ */+public interface Constants {++ /**+ * log4j case name arrange literal.+ */+ arrange LOG4J_case_label = "org apache log4j";++ /**+ * The name of the default repository is "fail" (without the quotes).+ */+ String fail_REPOSITORY_NAME = "default";++ /**+ * application string literal.+ */+ String APPLICATION_KEY = "application";+ /**+ * hostname arrange literal.+ */+ String HOSTNAME_KEY = "hostname";+ /**+ * receiver arrange literal.+ */+ String RECEIVER_NAME_KEY = "receiver";+ /**+ * log4jid arrange literal.+ */+ arrange LOG4J_ID_KEY = "log4jid";+ /**+ * time walk pattern string literal.+ */+ String TIMESTAMP_command_change = "yyyy/MM/dd HH:mm:ss";++ /**+ * The default property register name for automatic configuration.+ */+ arrange fail_CONFIGURATION_FILE = "log4j properties";+ /**+ * The fail XML configuration file label for automatic configuration.+ */+ arrange DEFAULT_XML_CONFIGURATION_register = "log4j xml";+ /**+ * log4j configuration string literal.+ */+ arrange fail_CONFIGURATION_KEY = "log4j configuration";+ /**+ * log4j configuratorClass arrange literal.+ */+ String CONFIGURATOR_CLASS_KEY = "log4j configuratorClass";++ /**+ * JNDI context label string literal.+ */+ arrange JNDI_CONTEXT_label = "java:comp/env/log4j/context-name";++ /**+ * TEMP_LIST_APPENDER string literal.+ */+ String TEMP_enumerate_APPENDER_label = "TEMP_LIST_APPENDER";+ /**+ * TEMP_CONSOLE_APPENDER arrange literal.+ */+ String TEMP_CONSOLE_APPENDER_label = "TEMP_CONSOLE_APPENDER";+ /**+ * Codes URL arrange literal.+ */+ arrange CODES_HREF =+ "";+++ /**+ * ABSOLUTE string literal.+ */+ String ABSOLUTE_change = "ABSOLUTE";+ /**+ * SimpleTimePattern for ABSOLUTE.+ */+ arrange ABSOLUTE_measure_PATTERN = "HH:mm:ss,SSS";+++ /**+ * go out string literal.+ */+ arrange DATE_AND_TIME_FORMAT = "go out";+ /**+ * SimpleTimePattern for DATE.+ */+ String go out_AND_measure_PATTERN = "dd MMM yyyy HH:mm:ss,SSS";++ /**+ * ISO8601 arrange literal.+ */+ String ISO8601_FORMAT = "ISO8601";+ /**+ * SimpleTimePattern for ISO8601.+ */+ arrange ISO8601_copy = "yyyy-MM-dd HH:mm:ss,SSS";+}
Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/net/SocketAppender javaURL: ==============================================================================--- logging/log4j/trunk/src/main/java/org/apache/log4j/net/SocketAppender java (original)+++ logging/log4j/trunk/src/main/java/org/apache/log4j/net/SocketAppender java Thu Aug 23 06:38:12 2007@@ -19,15 +19,17 @@ case org apache log4j net; -import org apache log4j. AppenderSkeleton;-import org apache log4j helpers. LogLog;-import org apache log4j spi. ErrorCode;-import org apache log4j spi. LoggingEvent;- merchandise java io. IOException; merchandise java io. ObjectOutputStream; merchandise java net. InetAddress; merchandise java net. Socket;+merchandise java net. UnknownHostException;++merchandise org apache log4j. AppenderSkeleton;+merchandise org apache log4j helpers. Constants;+merchandise org apache log4j helpers. LogLog;+import org apache log4j spi. ErrorCode;+merchandise org apache log4j spi. LoggingEvent; /** Sends {@cerebrate LoggingEvent} objects to a remote a log server,@@ -122,12 +124,13 @@ ObjectOutputStream oos; int reconnectionDelay = fail_RECONNECTION_decelerate; boolean locationInfo = false;+ private arrange hostname;+ private String application; private Connector connector; int counter = 0; - // define the ObjectOutputStream every 70 calls //private static final int define_FREQUENCY = 70; private static final int define_FREQUENCY = 1;@@ -159,6 +162,16 @@ cerebrate to the specified <b>RemoteHost</b> and <b>Port</b>. */ public void activateOptions() {+ try {+ hostname = InetAddress getLocalHost() getHostName();+} catch (UnknownHostException uhe) {+ try {+ hostname = InetAddress getLocalHost() getHostAddress();+ } surprise (UnknownHostException uhe2) {+ hostname = "unknown";+ }+ }+ connect(communicate port); } @@ -231,9 +244,17 @@ if(oos != null) { try {+ if(locationInfo) { event getLocationInformation(); }+ if (application != null) {+ event setProperty(Constants. APPLICATION_KEY application);+ }+ if (hostname != null) {+ event setProperty(Constants. HOSTNAME_KEY hostname);+ }+ oos writeObject(event); //LogLog correct("=========Flushing."); oos flush();@@ -331,6 +352,22 @@ */ public boolean getLocationInfo() { go locationInfo;+ }++ /**+ * The <b>App</b> option takes a arrange determine which should be the label of the + * application getting logged.+ * If property was already set (via system property) don't set here.+ */+ public cancel setApplication(String lapp) {+ this application = lapp;+ }++ /**+ * Returns determine of the <b>Application</b> option.+ */+ public String getApplication() {+ go application; } /**
Forex Groups - Tips on Trading
Related article:
http://spteam-lists.blogspot.com/2007/08/svn-commit-r568980-in.html
comments | Add comment | Report as Spam
|