Added: logging/site/trunk/docs/log4j/companions/component/xref/allclasses-frame.html URL: http://svn.apache.org/viewvc/logging/site/trunk/docs/log4j/companions/component/xref/allclasses-frame.html?view=auto&rev=558355 ============================================================================== --- logging/site/trunk/docs/log4j/companions/component/xref/allclasses-frame.html (added) +++ logging/site/trunk/docs/log4j/companions/component/xref/allclasses-frame.html Sat Jul 21 10:20:56 2007 @@ -0,0 +1,92 @@ + + + +
+ ++ You don't have frames. Go here +
+
+
+1 /*
+2 * Licensed to the Apache Software Foundation (ASF) under one or more
+3 * contributor license agreements. See the NOTICE file distributed with
+4 * this work for additional information regarding copyright ownership.
+5 * The ASF licenses this file to You under the Apache License, Version 2.0
+6 * (the "License"); you may not use this file except in compliance with
+7 * the License. You may obtain a copy of the License at
+8 *
+9 * http://www.apache.org/licenses/LICENSE-2.0
+10 *
+11 * Unless required by applicable law or agreed to in writing, software
+12 * distributed under the License is distributed on an "AS IS" BASIS,
+13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14 * See the License for the specific language governing permissions and
+15 * limitations under the License.
+16 */
+17
+18 package org.apache.log4j;
+19
+20 import org.apache.log4j.helpers.LogLog;
+21 import org.apache.log4j.or.ObjectRenderer;
+22 import org.apache.log4j.or.RendererMap;
+23 import org.apache.log4j.plugins.Plugin;
+24 import org.apache.log4j.plugins.PluginConfigurator;
+25 import org.apache.log4j.plugins.PluginRegistry;
+26 import org.apache.log4j.scheduler.Scheduler;
+27 import org.apache.log4j.spi.ErrorItem;
+28 import org.apache.log4j.spi.HierarchyEventListener;
+29 import org.apache.log4j.spi.LoggerEventListener;
+30 import org.apache.log4j.spi.LoggerFactory;
+31 import org.apache.log4j.spi.LoggerRepository;
+32 import org.apache.log4j.spi.LoggerRepositoryEventListener;
+33 import org.apache.log4j.spi.LoggerRepositoryEx;
+34 import org.apache.log4j.spi.OptionHandler;
+35 import org.apache.log4j.spi.RendererSupport;
+36 import org.apache.log4j.xml.UnrecognizedElementHandler;
+37 import org.w3c.dom.Element;
+38
+39 import java.util.ArrayList;
+40 import java.util.Enumeration;
+41 import java.util.HashMap;
+42 import java.util.Hashtable;
+43 import java.util.List;
+44 import java.util.Map;
+45 import java.util.Properties;
+46 import java.util.Vector;
+47
+48
+49 /***
+50 * This class implements LoggerRepositoryEx by
+51 * wrapping an existing LoggerRepository implementation
+52 * and implementing the newly added capabilities.
+53 */
+54 public final class LoggerRepositoryExImpl
+55 implements LoggerRepositoryEx,
+56 RendererSupport,
+57 UnrecognizedElementHandler {
+58
+59 /***
+60 * Wrapped logger repository.
+61 */
+62 private final LoggerRepository repo;
+63
+64 /***
+65 * Logger factory. Does not affect class of logger
+66 * created by underlying repository.
+67 */
+68 private LoggerFactory loggerFactory;
+69
+70 /***
+71 * Renderer support.
+72 */
+73 private final RendererSupport rendererSupport;
+74
+75 /***
+76 * List of repository event listeners.
+77 */
+78 private final ArrayList repositoryEventListeners = new ArrayList();
+79 /***
+80 * Map of HierarchyEventListener keyed by LoggingEventListener.
+81 */
+82 private final Map loggerEventListeners = new HashMap();
+83 /***
+84 * Name of hierarchy.
+85 */
+86 private String name;
+87 /***
+88 * Plug in registry.
+89 */
+90 private PluginRegistry pluginRegistry;
+91 /***
+92 * Properties.
+93 */
+94 private final Map properties = new Hashtable();
+95 /***
+96 * Scheduler.
+97 */
+98 private Scheduler scheduler;
+99
+100 /*** The repository can also be used as an object store
+101 * for various objects used by log4j components.
+102 */
+103 private Map objectMap = new HashMap();
+104
+105
+106 /***
+107 * Error list.
+108 */
+109 private List errorList = new Vector();
+110
+111 /***
+112 * True if hierarchy has not been modified.
+113 */
+114 private boolean pristine = true;
+115
+116 /***
+117 Constructs a new logger hierarchy.
+118
+119 @param repository Base implementation of repository.
+120
+121 */
+122 public LoggerRepositoryExImpl(final LoggerRepository repository) {
+123 super();
+124 if (repository == null) {
+125 throw new NullPointerException("repository");
+126 }
+127 repo = repository;
+128 if (repository instanceof RendererSupport) {
+129 rendererSupport = (RendererSupport) repository;
+130 } else {
+131 rendererSupport = new RendererSupportImpl();
+132 }
+133 }
+134
+135
+136 /***
+137 Add a {@link LoggerRepositoryEventListener} to the repository. The
+138 listener will be called when repository events occur.
+139 @param listener listener
+140 @since 1.3*/
+141 public void addLoggerRepositoryEventListener(
+142 final LoggerRepositoryEventListener listener) {
+143 synchronized (repositoryEventListeners) {
+144 if (repositoryEventListeners.contains(listener)) {
+145 LogLog.warn(
+146 "Ignoring attempt to add a previously "
+147 + "registered LoggerRepositoryEventListener.");
+148 } else {
+149 repositoryEventListeners.add(listener);
+150 }
+151 }
+152 }
+153
+154
+155 /***
+156 Remove a {@link LoggerRepositoryEventListener} from the repository.
+157 @param listener listener
+158 @since 1.3*/
+159 public void removeLoggerRepositoryEventListener(
+160 final LoggerRepositoryEventListener listener) {
+161 synchronized (repositoryEventListeners) {
+162 if (!repositoryEventListeners.contains(listener)) {
+163 LogLog.warn(
+164 "Ignoring attempt to remove a "
+165 + "non-registered LoggerRepositoryEventListener.");
+166 } else {
+167 repositoryEventListeners.remove(listener);
+168 }
+169 }
+170 }
+171
+172 /***
+173 Add a {@link LoggerEventListener} to the repository. The listener
+174 will be called when repository events occur.
+175 @param listener listener
+176 @since 1.3
+177 */
+178 public void addLoggerEventListener(final LoggerEventListener listener) {
+179 synchronized (loggerEventListeners) {
+180 if (loggerEventListeners.get(listener) != null) {
+181 LogLog.warn(
+182 "Ignoring attempt to add a previously registerd LoggerEventListener.");
+183 } else {
+184 HierarchyEventListenerProxy proxy =
+185 new HierarchyEventListenerProxy(listener);
+186 loggerEventListeners.put(listener, proxy);
+187 repo.addHierarchyEventListener(proxy);
+188 }
+189 }
+190 }
+191
+192 /***
+193 Add a {@link org.apache.log4j.spi.HierarchyEventListener}
+194 event to the repository.
+195 @param listener listener
+196 @deprecated Superceded by addLoggerEventListener
+197 */
+198 public
+199 void addHierarchyEventListener(final HierarchyEventListener listener) {
+200 repo.addHierarchyEventListener(listener);
+201 }
+202
+203
+204 /***
+205 Remove a {@link LoggerEventListener} from the repository.
+206 @param listener listener to be removed
+207 @since 1.3*/
+208 public void removeLoggerEventListener(final LoggerEventListener listener) {
+209 synchronized (loggerEventListeners) {
+210 HierarchyEventListenerProxy proxy =
+211 (HierarchyEventListenerProxy) loggerEventListeners.get(listener);
+212 if (proxy == null) {
+213 LogLog.warn(
+214 "Ignoring attempt to remove a non-registered LoggerEventListener.");
+215 } else {
+216 loggerEventListeners.remove(listener);
+217 proxy.disable();
+218 }
+219 }
+220 }
+221
+222 /***
+223 * Issue warning that there are no appenders in hierarchy.
+224 * @param cat logger, not currently used.
+225 */
+226 public void emitNoAppenderWarning(final Category cat) {
+227 repo.emitNoAppenderWarning(cat);
+228 }
+229
+230 /***
+231 Check if the named logger exists in the hierarchy. If so return
+232 its reference, otherwise returns <code>null</code>.
+233
+234 @param loggerName The name of the logger to search for.
+235 @return true if logger exists.
+236 */
+237 public Logger exists(final String loggerName) {
+238 return repo.exists(loggerName);
+239 }
+240
+241 /***
+242 * Return the name of this hierarchy.
+243 * @return name of hierarchy
+244 */
+245 public String getName() {
+246 return name;
+247 }
+248
+249 /***
+250 * Set the name of this repository.
+251 *
+252 * Note that once named, a repository cannot be rerenamed.
+253 * @since 1.3
+254 * @param repoName name of hierarchy
+255 */
+256 public void setName(final String repoName) {
+257 if (name == null) {
+258 name = repoName;
+259 } else if (!name.equals(repoName)) {
+260 throw new IllegalStateException(
+261 "Repository [" + name + "] cannot be renamed as [" + repoName + "].");
+262 }
+263 }
+264
+265 /***
+266 * {@inheritDoc}
+267 */
+268 public Map getProperties() {
+269 return properties;
+270 }
+271
+272 /***
+273 * {@inheritDoc}
+274 */
+275 public String getProperty(final String key) {
+276 return (String) properties.get(key);
+277 }
+278
+279 /***
+280 * Set a property by key and value. The property will be shared by all
+281 * events in this repository.
+282 * @param key property name
+283 * @param value property value
+284 */
+285 public void setProperty(final String key,
+286 final String value) {
+287 properties.put(key, value);
+288 }
+289
+290 /***
+291 The string form of {@link #setThreshold(Level)}.
+292 @param levelStr symbolic name for level
+293 */
+294 public void setThreshold(final String levelStr) {
+295 repo.setThreshold(levelStr);
+296 }
+297
+298 /***
+299 Enable logging for logging requests with level <code>l</code> or
+300 higher. By default all levels are enabled.
+301
+302 @param l The minimum level for which logging requests are sent to
+303 their appenders. */
+304 public void setThreshold(final Level l) {
+305 repo.setThreshold(l);
+306 }
+307
+308 /***
+309 * {@inheritDoc}
+310 * @since 1.3
+311 */
+312 public PluginRegistry getPluginRegistry() {
+313 if (pluginRegistry == null) {
+314 pluginRegistry = new PluginRegistry(this);
+315 }
+316 return pluginRegistry;
+317 }
+318
+319
+320 /***
+321 Requests that a appender added event be sent to any registered
+322 {@link LoggerEventListener}.
+323 @param logger The logger to which the appender was added.
+324 @param appender The appender added to the logger.
+325 */
+326 public void fireAddAppenderEvent(final Category logger,
+327 final Appender appender) {
+328 repo.fireAddAppenderEvent(logger, appender);
+329 }
+330
+331
+332 /***
+333 Requests that a appender removed event be sent to any registered
+334 {@link LoggerEventListener}.
+335 @param logger The logger from which the appender was removed.
+336 @param appender The appender removed from the logger.
+337 */
+338 public void fireRemoveAppenderEvent(final Category logger,
+339 final Appender appender) {
+340 if (repo instanceof Hierarchy) {
+341 ((Hierarchy) repo).fireRemoveAppenderEvent(logger, appender);
+342 }
+343 }
+344
+345
+346 /***
+347 Requests that a level changed event be sent to any registered
+348 {@link LoggerEventListener}.
+349 @param logger The logger which changed levels.
+350 @since 1.3*/
+351 public void fireLevelChangedEvent(final Logger logger) {
+352 }
+353
+354 /***
+355 *
+356 * Requests that a configuration changed event be sent to any registered
+357 * {@link LoggerRepositoryEventListener}.
+358 * @since 1.3*/
+359 public void fireConfigurationChangedEvent() {
+360 }
+361
+362
+363 /***
+364 Returns the current threshold.
+365 @return current threshold level
+366
+367 @since 1.2 */
+368 public Level getThreshold() {
+369 return repo.getThreshold();
+370 }
+371
+372
+373 /***
+374 Return a new logger instance named as the first parameter using
+375 the default factory.
+376
+377 <p>If a logger of that name already exists, then it will be
+378 returned. Otherwise, a new logger will be instantiated and
+379 then linked with its existing ancestors as well as children.
+380
+381 @param loggerName The name of the logger to retrieve.
+382 @return logger
+383
+384 */
+385 public Logger getLogger(final String loggerName) {
+386 return repo.getLogger(loggerName);
+387 }
+388
+389 /***
+390 Return a new logger instance named as the first parameter using
+391 <code>factory</code>.
+392
+393 <p>If a logger of that name already exists, then it will be
+394 returned. Otherwise, a new logger will be instantiated by the
+395 <code>factory</code> parameter and linked with its existing
+396 ancestors as well as children.
+397
+398 @param loggerName The name of the logger to retrieve.
+399 @param factory The factory that will make the new logger instance.
+400 @return logger
+401
+402 */
+403 public Logger getLogger(final String loggerName,
+404 final LoggerFactory factory) {
+405 return repo.getLogger(loggerName, factory);
+406 }
+407
+408 /***
+409 Returns all the currently defined categories in this hierarchy as
+410 an {@link java.util.Enumeration Enumeration}.
+411
+412 <p>The root logger is <em>not</em> included in the returned
+413 {@link Enumeration}.
+414 @return enumerator of current loggers
+415 */
+416 public Enumeration getCurrentLoggers() {
+417 return repo.getCurrentLoggers();
+418 }
+419
+420 /***
+421 * Return the the list of previously encoutered {@link ErrorItem error items}.
+422 * @return list of errors
+423 */
+424 public List getErrorList() {
+425 return errorList;
+426 }
+427
+428 /***
+429 * Add an error item to the list of previously encountered errors.
+430 * @param errorItem error to add to list of errors.
+431 * @since 1.3
+432 */
+433 public void addErrorItem(final ErrorItem errorItem) {
+434 getErrorList().add(errorItem);
+435 }
+436
+437 /***
+438 * Get enumerator over current loggers.
+439 * @return enumerator over current loggers
+440 @deprecated Please use {@link #getCurrentLoggers} instead.
+441 */
+442 public Enumeration getCurrentCategories() {
+443 return repo.getCurrentCategories();
+444 }
+445
+446 /***
+447 Get the renderer map for this hierarchy.
+448 @return renderer map
+449 */
+450 public RendererMap getRendererMap() {
+451 return rendererSupport.getRendererMap();
+452 }
+453
+454 /***
+455 Get the root of this hierarchy.
+456
+457 @since 0.9.0
+458 @return root of hierarchy
+459 */
+460 public Logger getRootLogger() {
+461 return repo.getRootLogger();
+462 }
+463
+464 /***
+465 This method will return <code>true</code> if this repository is
+466 disabled for <code>level</code> value passed as parameter and
+467 <code>false</code> otherwise. See also the {@link
+468 #setThreshold(Level) threshold} method.
+469 @param level numeric value for level.
+470 @return true if disabled for specified level
+471 */
+472 public boolean isDisabled(final int level) {
+473 return repo.isDisabled(level);
+474 }
+475
+476 /***
+477 Reset all values contained in this hierarchy instance to their
+478 default. This removes all appenders from all categories, sets
+479 the level of all non-root categories to <code>null</code>,
+480 sets their additivity flag to <code>true</code> and sets the level
+481 of the root logger to DEBUG. Moreover,
+482 message disabling is set its default "off" value.
+483
+484 <p>Existing categories are not removed. They are just reset.
+485
+486 <p>This method should be used sparingly and with care as it will
+487 block all logging until it is completed.</p>
+488
+489 @since 0.8.5 */
+490 public void resetConfiguration() {
+491 repo.resetConfiguration();
+492 }
+493
+494 /***
+495 Used by subclasses to add a renderer to the hierarchy passed as parameter.
+496 @param renderedClass class
+497 @param renderer object used to render class.
+498 */
+499 public void setRenderer(final Class renderedClass,
+500 final ObjectRenderer renderer) {
+501 rendererSupport.setRenderer(renderedClass, renderer);
+502 }
+503
+504 /***
+505 * {@inheritDoc}
+506 */
+507 public boolean isPristine() {
+508 return pristine;
+509 }
+510
+511 /***
+512 * {@inheritDoc}
+513 */
+514 public void setPristine(final boolean state) {
+515 pristine = state;
+516 }
+517
+518 /***
+519 Shutting down a hierarchy will <em>safely</em> close and remove
+520 all appenders in all categories including the root logger.
+521
+522 <p>Some appenders such as org.apache.log4j.net.SocketAppender
+523 and AsyncAppender need to be closed before the
+524 application exists. Otherwise, pending logging events might be
+525 lost.
+526
+527 <p>The <code>shutdown</code> method is careful to close nested
+528 appenders before closing regular appenders. This is allows
+529 configurations where a regular appender is attached to a logger
+530 and again to a nested appender.
+531
+532 @since 1.0 */
+533 public void shutdown() {
+534 repo.shutdown();
+535 }
+536
+537
+538 /***
+539 * Return this repository's own scheduler.
+540 * The scheduler is lazily instantiated.
+541 * @return this repository's own scheduler.
+542 */
+543 public Scheduler getScheduler() {
+544 if (scheduler == null) {
+545 scheduler = new Scheduler();
+546 scheduler.setDaemon(true);
+547 scheduler.start();
+548 }
+549 return scheduler;
+550 }
+551
+552 /***
+553 * Puts object by key.
+554 * @param key key, may not be null.
+555 * @param value object to associate with key.
+556 */
+557 public void putObject(final String key,
+558 final Object value) {
+559 objectMap.put(key, value);
+560 }
+561
+562 /***
+563 * Get object by key.
+564 * @param key key, may not be null.
+565 * @return object associated with key or null.
+566 */
+567 public Object getObject(final String key) {
+568 return objectMap.get(key);
+569 }
+570
+571 /***
+572 * Set logger factory.
+573 * @param factory logger factory.
+574 */
+575 public void setLoggerFactory(final LoggerFactory factory) {
+576 if (factory == null) {
+577 throw new NullPointerException();
+578 }
+579 this.loggerFactory = factory;
+580 }
+581
+582 /***
+583 * Get logger factory.
+584 * @return logger factory.
+585 */
+586 public LoggerFactory getLoggerFactory() {
+587 return loggerFactory;
+588 }
+589
+590 /*** {@inheritDoc} */
+591 public boolean parseUnrecognizedElement(
+592 final Element element,
+593 final Properties props) throws Exception {
+594 if ("plugin".equals(element.getNodeName())) {
+595 OptionHandler instance =
+596 PluginConfigurator.parseElement(element, props, Plugin.class);
+597 if (instance instanceof Plugin) {
+598 Plugin plugin = (Plugin) instance;
+599 String pluginName = PluginConfigurator.subst(element.getAttribute("name"), props);
+600 if (pluginName.length() > 0) {
+601 plugin.setName(pluginName);
+602 }
+603 getPluginRegistry().addPlugin(plugin);
+604 plugin.setLoggerRepository(this);
+605
+606 LogLog.debug("Pushing plugin on to the object stack.");
+607 instance.activateOptions();
+608 return true;
+609 }
+610 }
+611 return false;
+612 }
+613
+614
+615
+616 /***
+617 * Implementation of RendererSupportImpl if not
+618 * provided by LoggerRepository.
+619 */
+620 private static final class RendererSupportImpl implements RendererSupport {
+621 /***
+622 * Renderer map.
+623 */
+624 private final RendererMap renderers = new RendererMap();
+625
+626 /***
+627 * Create new instance.
+628 */
+629 public RendererSupportImpl() {
+630 super();
+631 }
+632
+633 /*** {@inheritDoc} */
+634 public RendererMap getRendererMap() {
+635 return renderers;
+636 }
+637
+638 /*** {@inheritDoc} */
+639 public void setRenderer(final Class renderedClass,
+640 final ObjectRenderer renderer) {
+641 renderers.put(renderedClass, renderer);
+642 }
+643 }
+644
+645 /***
+646 * Proxy that implements HierarchyEventListener
+647 * and delegates to LoggerEventListener.
+648 */
+649 private static final class HierarchyEventListenerProxy
+650 implements HierarchyEventListener {
+651 /***
+652 * Wrapper listener.
+653 */
+654 private LoggerEventListener listener;
+655
+656 /***
+657 * Creates new instance.
+658 * @param l listener
+659 */
+660 public HierarchyEventListenerProxy(final LoggerEventListener l) {
+661 super();
+662 if (l == null) {
+663 throw new NullPointerException("l");
+664 }
+665 listener = l;
+666 }
+667
+668 /*** {@inheritDoc} */
+669 public void addAppenderEvent(final Category cat,
+670 final Appender appender) {
+671 if (isEnabled() && cat instanceof Logger) {
+672 listener.appenderAddedEvent((Logger) cat, appender);
+673 }
+674 }
+675
+676 /*** {@inheritDoc} */
+677 public void removeAppenderEvent(final Category cat,
+678 final Appender appender) {
+679 if (isEnabled() && cat instanceof Logger) {
+680 listener.appenderRemovedEvent((Logger) cat, appender);
+681 }
+682 }
+683
+684 /***
+685 * Disable forwarding of notifications to
+686 * simulate removal of listener.
+687 */
+688 public synchronized void disable() {
+689 listener = null;
+690 }
+691
+692 /***
+693 * Gets whether proxy is enabled.
+694 * @return true if proxy is enabled.
+695 */
+696 private synchronized boolean isEnabled() {
+697 return listener != null;
+698 }
+699 }
+700
+701 }
+
+
+
+1 /*
+2 * Licensed to the Apache Software Foundation (ASF) under one or more
+3 * contributor license agreements. See the NOTICE file distributed with
+4 * this work for additional information regarding copyright ownership.
+5 * The ASF licenses this file to You under the Apache License, Version 2.0
+6 * (the "License"); you may not use this file except in compliance with
+7 * the License. You may obtain a copy of the License at
+8 *
+9 * http://www.apache.org/licenses/LICENSE-2.0
+10 *
+11 * Unless required by applicable law or agreed to in writing, software
+12 * distributed under the License is distributed on an "AS IS" BASIS,
+13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14 * See the License for the specific language governing permissions and
+15 * limitations under the License.
+16 */
+17
+18 package org.apache.log4j;
+19
+20
+21 /***
+22 * A proxy for org.slf4j.ULogger. In slf4j implementing builds, this
+23 * interface will extend org.slf4j.ULogger and add no additional methods.
+24 *
+25 * @author Ceki Gülcü
+26 * @author Curt Arnold
+27 */
+28 public interface ULogger {
+29
+30
+31 /***
+32 * Is the logger instance enabled for the DEBUG level?
+33 * @return true if debug is enabled.
+34 */
+35 boolean isDebugEnabled();
+36
+37 /***
+38 * Log a message object with the DEBUG level.
+39 * @param msg - the message object to be logged
+40 */
+41 void debug(Object msg);
+42
+43
+44 /***
+45 * Log a parameterized message object at the DEBUG level.
+46 *
+47 * <p>This form is useful in avoiding the superflous object creation
+48 * problem when invoking this method while it is disabled.
+49 * </p>
+50 * @param parameterizedMsg - the parameterized message object
+51 * @param param1 - the parameter
+52 */
+53 void debug(Object parameterizedMsg, Object param1);
+54
+55 /***
+56 * Log a parameterized message object at the DEBUG level.
+57 *
+58 * <p>This form is useful in avoiding the superflous object creation
+59 * problem when invoking this method while it is disabled.
+60 * </p>
+61 * @param parameterizedMsg - the parameterized message object
+62 * @param param1 - the first parameter
+63 * @param param2 - the second parameter
+64 */
+65 void debug(String parameterizedMsg, Object param1, Object param2);
+66 /***
+67 * Log a message object with the <code>DEBUG</code> level including the
+68 * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
+69 *
+70 *
+71 * @param msg the message object to log.
+72 * @param t the exception to log, including its stack trace.
+73 */
+74 void debug(Object msg, Throwable t);
+75
+76
+77 /***
+78 * Is the logger instance enabled for the INFO level?
+79 * @return true if debug is enabled.
+80 */
+81 boolean isInfoEnabled();
+82 /***
+83 * Log a message object with the INFO level.
+84 * @param msg - the message object to be logged
+85 */
+86 void info(Object msg);
+87 /***
+88 * Log a parameterized message object at the INFO level.
+89 *
+90 * <p>This form is useful in avoiding the superflous object creation
+91 * problem when invoking this method while it is disabled.
+92 * </p>
+93 * @param parameterizedMsg - the parameterized message object
+94 * @param param1 - the parameter
+95 */
+96 void info(Object parameterizedMsg, Object param1);
+97 /***
+98 * Log a parameterized message object at the INFO level.
+99 *
+100 * <p>This form is useful in avoiding the superflous object creation
+101 * problem when invoking this method while it is disabled.
+102 * </p>
+103 * @param parameterizedMsg - the parameterized message object
+104 * @param param1 - the first parameter
+105 * @param param2 - the second parameter
+106 */
+107 void info(String parameterizedMsg, Object param1, Object param2);
+108 /***
+109 * Log a message object with the <code>INFO</code> level including the
+110 * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
+111 *
+112 *
+113 * @param msg the message object to log.
+114 * @param t the exception to log, including its stack trace.
+115 */
+116 void info(Object msg, Throwable t);
+117
+118
+119 /***
+120 * Is the logger instance enabled for the WARN level?
+121 * @return true if debug is enabled.
+122 */
+123 boolean isWarnEnabled();
+124 /***
+125 * Log a message object with the WARN level.
+126 * @param msg - the message object to be logged
+127 */
+128 void warn(Object msg);
+129 /***
+130 * Log a parameterized message object at the WARN level.
+131 *
+132 * <p>This form is useful in avoiding the superflous object creation
+133 * problem when invoking this method while it is disabled.
+134 * </p>
+135 * @param parameterizedMsg - the parameterized message object
+136 * @param param1 - the parameter
+137 */
+138 void warn(Object parameterizedMsg, Object param1);
+139 /***
+140 * Log a parameterized message object at the WARN level.
+141 *
+142 * <p>This form is useful in avoiding the superflous object creation
+143 * problem when invoking this method while it is disabled.
+144 * </p>
+145 * @param parameterizedMsg - the parameterized message object
+146 * @param param1 - the first parameter
+147 * @param param2 - the second parameter
+148 */
+149 void warn(String parameterizedMsg, Object param1, Object param2);
+150 /***
+151 * Log a message object with the <code>WARN</code> level including the
+152 * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
+153 *
+154 *
+155 * @param msg the message object to log.
+156 * @param t the exception to log, including its stack trace.
+157 */
+158 void warn(Object msg, Throwable t);
+159
+160
+161 /***
+162 * Is the logger instance enabled for the ERROR level?
+163 * @return true if debug is enabled.
+164 */
+165 boolean isErrorEnabled();
+166 /***
+167 * Log a message object with the ERROR level.
+168 * @param msg - the message object to be logged
+169 */
+170 void error(Object msg);
+171 /***
+172 * Log a parameterized message object at the ERROR level.
+173 *
+174 * <p>This form is useful in avoiding the superflous object creation
+175 * problem when invoking this method while it is disabled.
+176 * </p>
+177 * @param parameterizedMsg - the parameterized message object
+178 * @param param1 - the parameter
+179 */
+180 void error(Object parameterizedMsg, Object param1);
+181 /***
+182 * Log a parameterized message object at the ERROR level.
+183 *
+184 * <p>This form is useful in avoiding the superflous object creation
+185 * problem when invoking this method while it is disabled.
+186 * </p>
+187 * @param parameterizedMsg - the parameterized message object
+188 * @param param1 - the first parameter
+189 * @param param2 - the second parameter
+190 */
+191 void error(String parameterizedMsg, Object param1, Object param2);
+192
+193 /***
+194 * Log a message object with the <code>ERROR</code> level including the
+195 * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
+196 *
+197 *
+198 * @param msg the message object to log.
+199 * @param t the exception to log, including its stack trace.
+200 */
+201 void error(Object msg, Throwable t);
+202
+203 }
+
+
+
+1 /*
+2 * Licensed to the Apache Software Foundation (ASF) under one or more
+3 * contributor license agreements. See the NOTICE file distributed with
+4 * this work for additional information regarding copyright ownership.
+5 * The ASF licenses this file to You under the Apache License, Version 2.0
+6 * (the "License"); you may not use this file except in compliance with
+7 * the License. You may obtain a copy of the License at
+8 *
+9 * http://www.apache.org/licenses/LICENSE-2.0
+10 *
+11 * Unless required by applicable law or agreed to in writing, software
+12 * distributed under the License is distributed on an "AS IS" BASIS,
+13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14 * See the License for the specific language governing permissions and
+15 * limitations under the License.
+16 */
+17
+18 package org.apache.log4j.helpers;
+19
+20
+21 /***
+22 * Constants used internally throughout log4j.
+23 *
+24 * @since 1.3
+25 */
+26 public interface Constants {
+27
+28 /***
+29 * log4j package name string literal.
+30 */
+31 String LOG4J_PACKAGE_NAME = "org.apache.log4j";
+32
+33 /***
+34 * The name of the default repository is "default" (without the quotes).
+35 */
+36 String DEFAULT_REPOSITORY_NAME = "default";
+37
+38 /***
+39 * application string literal.
+40 */
+41 String APPLICATION_KEY = "application";
+42 /***
+43 * hostname string literal.
+44 */
+45 String HOSTNAME_KEY = "hostname";
+46 /***
+47 * receiver string literal.
+48 */
+49 String RECEIVER_NAME_KEY = "receiver";
+50 /***
+51 * log4jid string literal.
+52 */
+53 String LOG4J_ID_KEY = "log4jid";
+54 /***
+55 * time stamp pattern string literal.
+56 */
+57 String TIMESTAMP_RULE_FORMAT = "yyyy/MM/dd HH:mm:ss";
+58
+59 /***
+60 * The default property file name for automatic configuration.
+61 */
+62 String DEFAULT_CONFIGURATION_FILE = "log4j.properties";
+63 /***
+64 * The default XML configuration file name for automatic configuration.
+65 */
+66 String DEFAULT_XML_CONFIGURATION_FILE = "log4j.xml";
+67 /***
+68 * log4j.configuration string literal.
+69 */
+70 String DEFAULT_CONFIGURATION_KEY = "log4j.configuration";
+71 /***
+72 * log4j.configuratorClass string literal.
+73 */
+74 String CONFIGURATOR_CLASS_KEY = "log4j.configuratorClass";
+75
+76 /***
+77 * JNDI context name string literal.
+78 */
+79 String JNDI_CONTEXT_NAME = "java:comp/env/log4j/context-name";
+80
+81 /***
+82 * TEMP_LIST_APPENDER string literal.
+83 */
+84 String TEMP_LIST_APPENDER_NAME = "TEMP_LIST_APPENDER";
+85 /***
+86 * TEMP_CONSOLE_APPENDER string literal.
+87 */
+88 String TEMP_CONSOLE_APPENDER_NAME = "TEMP_CONSOLE_APPENDER";
+89 /***
+90 * Codes URL string literal.
+91 */
+92 String CODES_HREF =
+93 "http://logging.apache.org/log4j/docs/codes.html";
+94
+95
+96 /***
+97 * ABSOLUTE string literal.
+98 */
+99 String ABSOLUTE_FORMAT = "ABSOLUTE";
+100 /***
+101 * SimpleTimePattern for ABSOLUTE.
+102 */
+103 String ABSOLUTE_TIME_PATTERN = "HH:mm:ss,SSS";
+104
+105
+106 /***
+107 * DATE string literal.
+108 */
+109 String DATE_AND_TIME_FORMAT = "DATE";
+110 /***
+111 * SimpleTimePattern for DATE.
+112 */
+113 String DATE_AND_TIME_PATTERN = "dd MMM yyyy HH:mm:ss,SSS";
+114
+115 /***
+116 * ISO8601 string literal.
+117 */
+118 String ISO8601_FORMAT = "ISO8601";
+119 /***
+120 * SimpleTimePattern for ISO8601.
+121 */
+122 String ISO8601_PATTERN = "yyyy-MM-dd HH:mm:ss,SSS";
+123 }
+
+