Commit 4b4446d2 authored by kchakraborty's avatar kchakraborty

Deleting because of wrong branch OCCTP-2925

parent 57dff3fd
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file 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 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.
*/
package org.apache.log4j;
import org.apache.log4j.spi.Filter;
import org.apache.log4j.spi.ErrorHandler;
import org.apache.log4j.spi.LoggingEvent;
/**
Implement this interface for your own strategies for outputting log
statements.
@author Ceki Gülcü
*/
public interface Appender {
/**
Add a filter to the end of the filter list.
@since 0.9.0
*/
void addFilter(Filter newFilter);
/**
Returns the head Filter. The Filters are organized in a linked list
and so all Filters on this Appender are available through the result.
@return the head Filter or null, if no Filters are present
@since 1.1
*/
public
Filter getFilter();
/**
Clear the list of filters by removing all the filters in it.
@since 0.9.0
*/
public
void clearFilters();
/**
Release any resources allocated within the appender such as file
handles, network connections, etc.
<p>It is a programming error to append to a closed appender.
@since 0.8.4
*/
public
void close();
/**
Log in <code>Appender</code> specific way. When appropriate,
Loggers will call the <code>doAppend</code> method of appender
implementations in order to log. */
public
void doAppend(LoggingEvent event);
/**
Get the name of this appender.
@return name, may be null.*/
public
String getName();
/**
Set the {@link ErrorHandler} for this appender.
@since 0.9.0
*/
public
void setErrorHandler(ErrorHandler errorHandler);
/**
Returns the {@link ErrorHandler} for this appender.
@since 1.1
*/
public
ErrorHandler getErrorHandler();
/**
Set the {@link Layout} for this appender.
@since 0.8.1
*/
public
void setLayout(Layout layout);
/**
Returns this appenders layout.
@since 1.1
*/
public
Layout getLayout();
/**
Set the name of this appender. The name is used by other
components to identify this appender.
@since 0.8.1
*/
public
void setName(String name);
/**
Configurators call this method to determine if the appender
requires a layout. If this method returns <code>true</code>,
meaning that layout is required, then the configurator will
configure an layout using the configuration information at its
disposal. If this method returns <code>false</code>, meaning that
a layout is not required, then layout configuration will be
skipped even if there is available layout configuration
information at the disposal of the configurator..
<p>In the rather exceptional case, where the appender
implementation admits a layout but can also work without it, then
the appender should return <code>true</code>.
@since 0.8.4 */
public
boolean requiresLayout();
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file 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 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.
*/
package org.apache.log4j;
import org.apache.log4j.spi.Filter;
import org.apache.log4j.spi.ErrorHandler;
import org.apache.log4j.spi.OptionHandler;
import org.apache.log4j.spi.LoggingEvent;
/**
* Abstract superclass of the other appenders in the package.
*
* This class provides the code for common functionality, such as
* support for threshold filtering and support for general filters.
*
* @since 0.8.1
* @author Ceki G&uuml;lc&uuml;
* */
public abstract class AppenderSkeleton implements Appender, OptionHandler {
/**
* Create new instance.
*/
public AppenderSkeleton() {
super();
}
/**
* Create new instance.
* Provided for compatibility with log4j 1.3.
*
* @param isActive true if appender is ready for use upon construction.
* Not used in log4j 1.2.x.
* @since 1.2.15
*/
protected AppenderSkeleton(final boolean isActive) {
super();
}
/**
Derived appenders should override this method if option structure
requires it. */
public
void activateOptions() {
}
/**
Add a filter to end of the filter list.
@since 0.9.0
*/
public
void addFilter(Filter newFilter) {
}
/**
Clear the filters chain.
@since 0.9.0 */
public
void clearFilters() {
}
/**
Finalize this appender by calling the derived class'
<code>close</code> method.
@since 0.8.4 */
public
void finalize() {
try{
super.finalize();
}
catch(Throwable t)
{
}
}
/**
Return the currently set {@link ErrorHandler} for this
Appender.
@since 0.9.0 */
public
ErrorHandler getErrorHandler() {
return null;
}
/**
Returns the head Filter.
@since 1.1
*/
public
Filter getFilter() {
return null;
}
/**
Return the first filter in the filter chain for this
Appender. The return value may be <code>null</code> if no is
filter is set.
*/
public
final
Filter getFirstFilter() {
return null;
}
/**
Returns the layout of this appender. The value may be null.
*/
public
Layout getLayout() {
return null;
}
/**
Returns the name of this appender.
@return name, may be null.
*/
public
final
String getName() {
return null;
}
/**
Returns this appenders threshold level. See the {@link
#setThreshold} method for the meaning of this option.
@since 1.1 */
public
Priority getThreshold() {
return null;
}
/**
Check whether the message level is below the appender's
threshold. If there is no threshold set, then the return value is
always <code>true</code>.
*/
public
boolean isAsSevereAsThreshold(Priority priority) {
return false;
}
/**
* This method performs threshold checks and invokes filters before
* delegating actual logging to the subclasses specific {@link
* AppenderSkeleton#append} method.
* */
public
synchronized
void doAppend(LoggingEvent event) {
}
/**
Set the {@link ErrorHandler} for this Appender.
@since 0.9.0
*/
public
synchronized
void setErrorHandler(ErrorHandler eh) {
}
/**
Set the layout for this appender. Note that some appenders have
their own (fixed) layouts or do not use one. For example, the
{@link org.apache.log4j.net.SocketAppender} ignores the layout set
here.
*/
public
void setLayout(Layout layout) {
}
/**
Set the name of this Appender.
*/
public
void setName(String name) {
}
/**
Set the threshold level. All log events with lower level
than the threshold level are ignored by the appender.
<p>In configuration files this option is specified by setting the
value of the <b>Threshold</b> option to a level
string, such as "DEBUG", "INFO" and so on.
@since 0.8.3 */
public
void setThreshold(Priority threshold) {
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file 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 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.
*/
// Contibutors: Aaron Greenhouse <aarong@cs.cmu.edu>
// Thomas Tuft Muller <ttm@online.no>
package org.apache.log4j;
import java.util.Enumeration;
import org.apache.log4j.spi.AppenderAttachable;
import org.apache.log4j.spi.LoggingEvent;
/**
* The AsyncAppender lets users log events asynchronously.
* <p/>
* <p/>
* The AsyncAppender will collect the events sent to it and then dispatch them
* to all the appenders that are attached to it. You can attach multiple
* appenders to an AsyncAppender.
* </p>
* <p/>
* <p/>
* The AsyncAppender uses a separate thread to serve the events in its buffer.
* </p>
* <p/>
* <b>Important note:</b> The <code>AsyncAppender</code> can only be script
* configured using the {@link org.apache.log4j.xml.DOMConfigurator}.
* </p>
*
* @author Ceki G&uuml;lc&uuml;
* @author Curt Arnold
* @since 0.9.1
*/
public class AsyncAppender extends AppenderSkeleton
implements AppenderAttachable {
/**
* Create new instance.
*/
public AsyncAppender() {
}
/**
* Add appender.
*
* @param newAppender appender to add, may not be null.
*/
public void addAppender(final Appender newAppender) {
}
/**
* {@inheritDoc}
*/
public void append(final LoggingEvent event) {
}
/**
* Close this <code>AsyncAppender</code> by interrupting the dispatcher
* thread which will process all pending events before exiting.
*/
public void close() {
}
/**
* Get iterator over attached appenders.
* @return iterator or null if no attached appenders.
*/
public Enumeration getAllAppenders() {
return null;
}
/**
* Get appender by name.
*
* @param name name, may not be null.
* @return matching appender or null.
*/
public Appender getAppender(final String name) {
return null;
}
/**
* Gets whether the location of the logging request call
* should be captured.
*
* @return the current value of the <b>LocationInfo</b> option.
*/
public boolean getLocationInfo() {
return false;
}
/**
* Determines if specified appender is attached.
* @param appender appender.
* @return true if attached.
*/
public boolean isAttached(final Appender appender) {
return false;
}
/**
* {@inheritDoc}
*/
public boolean requiresLayout() {
return false;
}
/**
* Removes and closes all attached appenders.
*/
public void removeAllAppenders() {
}
/**
* Removes an appender.
* @param appender appender to remove.
*/
public void removeAppender(final Appender appender) {
}
/**
* Remove appender by name.
* @param name name.
*/
public void removeAppender(final String 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/>
* <p/>
* Location information extraction is comparatively very slow and should be
* avoided unless performance is not a concern.
* </p>
* @param flag true if location information should be extracted.
*/
public void setLocationInfo(final boolean flag) {
}
/**
* Sets the number of messages allowed in the event buffer
* before the calling thread is blocked (if blocking is true)
* or until messages are summarized and discarded. Changing
* the size will not affect messages already in the buffer.
*
* @param size buffer size, must be positive.
*/
public void setBufferSize(final int size) {
}
/**
* Gets the current buffer size.
* @return the current value of the <b>BufferSize</b> option.
*/
public int getBufferSize() {
return 0;
}
/**
* Sets whether appender should wait if there is no
* space available in the event buffer or immediately return.
*
* @since 1.2.14
* @param value true if appender should wait until available space in buffer.
*/
public void setBlocking(final boolean value) {
}
/**
* Gets whether appender should block calling thread when buffer is full.
* If false, messages will be counted by logger and a summary
* message appended after the contents of the buffer have been appended.
*
* @since 1.2.14
* @return true if calling thread will be blocked when buffer is full.
*/
public boolean getBlocking() {
return false;
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file 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 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.
*/
// Contibutors: "Luke Blanshard" <Luke@quiq.com>
// "Mark DONSZELMANN" <Mark.Donszelmann@cern.ch>
// "Muly Oved" <mulyoved@hotmail.com>
package org.apache.log4j;
/**
Use this class to quickly configure the package.
<p>For file based configuration see {@link
PropertyConfigurator}. For XML based configuration see {@link
org.apache.log4j.xml.DOMConfigurator DOMConfigurator}.
@since 0.8.1
@author Ceki G&uuml;lc&uuml; */
public class BasicConfigurator {
protected BasicConfigurator() {
}
/**
Add a {@link ConsoleAppender} that uses {@link PatternLayout}
using the {@link PatternLayout#TTCC_CONVERSION_PATTERN} and
prints to <code>System.out</code> to the root category. */
static
public
void configure() {
}
/**
Add <code>appender</code> to the root category.
@param appender The appender to add to the root category.
*/
static
public
void configure(Appender appender) {
}
/**
Reset the default hierarchy to its defaut. It is equivalent to
calling
<code>Category.getDefaultHierarchy().resetConfiguration()</code>.
See {@link Hierarchy#resetConfiguration()} for more details. */
public
static