/** @deprecated Deprecated with no replacement. */ public void overrideAsNeeded(String override) { LogLog.warn("The Hiearchy.overrideAsNeeded method has been deprecated."); }
/** Does nothing. @deprecated Deprecated with no replacement. */ public void setDisableOverride(String override) { LogLog.warn("The Hiearchy.setDisableOverride method has been deprecated."); }
/** Set the {@link ErrorHandler} for this Appender. @since 0.9.0 */ public synchronized void setErrorHandler(ErrorHandler eh) { if(eh == null) { // We do not throw exception here since the cause is probably a // bad config file. LogLog.warn("You have tried to set a null error-handler."); } else { this.errorHandler = eh; } }
public void emitNoAppenderWarning(Category cat) { // No appenders in hierarchy, warn user only once. if(!this.emittedNoAppenderWarning) { LogLog.warn("No appenders could be found for logger (" + cat.getName() + ")."); LogLog.warn("Please initialize the log4j system properly."); LogLog.warn("See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info."); this.emittedNoAppenderWarning = true; } }
private static Object createJmDNSVersion3() { try { Method jmDNSCreateMethod = jmDNSClass.getMethod("create", null); return jmDNSCreateMethod.invoke(null, null); } catch (IllegalAccessException e) { LogLog.warn("Unable to instantiate jmdns class", e); } catch (NoSuchMethodException e) { LogLog.warn("Unable to access constructor", e); } catch (InvocationTargetException e) { LogLog.warn("Unable to call constructor", e); } return null; }
public void addHierarchyEventListener(HierarchyEventListener listener) { if(listeners.contains(listener)) { LogLog.warn("Ignoring attempt to add an existent listener."); } else { listeners.addElement(listener); } }
public void unadvertise() { try { Method method = jmDNSClass.getMethod("unregisterService", new Class[]{serviceInfoClass}); method.invoke(jmDNS, new Object[]{serviceInfo}); LogLog.debug("unregistered serviceInfo: " + serviceInfo); } catch(IllegalAccessException e) { LogLog.warn("Unable to invoke unregisterService method", e); } catch(NoSuchMethodException e) { LogLog.warn("No unregisterService method", e); } catch(InvocationTargetException e) { LogLog.warn("Unable to invoke unregisterService method", e); } }
public void advertise() { try { Method method = jmDNSClass.getMethod("registerService", new Class[]{serviceInfoClass}); method.invoke(jmDNS, new Object[]{serviceInfo}); LogLog.debug("registered serviceInfo: " + serviceInfo); } catch(IllegalAccessException e) { LogLog.warn("Unable to invoke registerService method", e); } catch(NoSuchMethodException e) { LogLog.warn("No registerService method", e); } catch(InvocationTargetException e) { LogLog.warn("Unable to invoke registerService method", e); } }
public InputSource resolveEntity (String publicId, String systemId) { if (systemId.endsWith("log4j.dtd") || PUBLIC_ID.equals(publicId)) { Class clazz = getClass(); InputStream in = clazz.getResourceAsStream("/org/apache/log4j/xml/log4j.dtd"); if (in == null) { LogLog.warn("Could not find [log4j.dtd] using [" + clazz.getClassLoader() + "] class loader, parsed without DTD."); in = new ByteArrayInputStream(new byte[0]); } return new InputSource(in); } else { return null; } } }
/** The string form of {@link #setThreshold(Level)}. */ public void setThreshold(String levelStr) { Level l = (Level) Level.toLevel(levelStr, null); if(l != null) { setThreshold(l); } else { LogLog.warn("Could not convert ["+levelStr+"] to Level."); } }
/** Set the {@link ErrorHandler} for this WriterAppender and also the underlying {@link QuietWriter} if any. */ public synchronized void setErrorHandler(ErrorHandler eh) { if(eh == null) { LogLog.warn("You have tried to set a null error-handler."); } else { this.errorHandler = eh; if(this.qw != null) { this.qw.setErrorHandler(eh); } } }
/** * Substitutes property value for any references in expression. * * @param value value from configuration file, may contain * literal text, property references or both * @param props properties. * @return evaluated expression, may still contain expressions * if unable to expand. * @since 1.2.15 */ public static String subst(final String value, final Properties props) { try { return OptionConverter.substVars(value, props); } catch (IllegalArgumentException e) { LogLog.warn("Could not perform variable substitution.", e); return value; } }
/** If the value of <b>File</b> is not <code>null</code>, then {@link #setFile} is called with the values of <b>File</b> and <b>Append</b> properties. @since 0.8.1 */ public void activateOptions() { if(fileName != null) { try { setFile(fileName, fileAppend, bufferedIO, bufferSize); } catch(java.io.IOException e) { errorHandler.error("setFile("+fileName+","+fileAppend+") call failed.", e, ErrorCode.FILE_OPEN_FAILURE); } } else { //LogLog.error("File option not set for appender ["+name+"]."); LogLog.warn("File option not set for appender ["+name+"]."); LogLog.warn("Are you using FileAppender instead of ConsoleAppender?"); } }
/** * Delegates unrecognized content to created instance if * it supports UnrecognizedElementParser. * @since 1.2.15 * @param instance instance, may be null. * @param element element, may not be null. * @param props properties * @throws IOException thrown if configuration of owner object * should be abandoned. */ private static void parseUnrecognizedElement(final Object instance, final Element element, final Properties props) throws Exception { boolean recognized = false; if (instance instanceof UnrecognizedElementHandler) { recognized = ((UnrecognizedElementHandler) instance).parseUnrecognizedElement( element, props); } if (!recognized) { LogLog.warn("Unrecognized element " + element.getNodeName()); } }
private static Object initializeJMDNS() { try { jmDNSClass = Class.forName("javax.jmdns.JmDNS"); serviceInfoClass = Class.forName("javax.jmdns.ServiceInfo"); } catch (ClassNotFoundException e) { LogLog.warn("JmDNS or serviceInfo class not found", e); } //if version 3 is available, use it to constuct a serviceInfo instance, otherwise support the version1 API boolean isVersion3 = false; try { //create method is in version 3, not version 1 jmDNSClass.getMethod("create", null); isVersion3 = true; } catch (NoSuchMethodException e) { //no-op } if (isVersion3) { return createJmDNSVersion3(); } else { return createJmDNSVersion1(); } }
@Override public void doOnChange() { new DOMConfigurator().doConfigure(filename, LogManager.getLoggerRepository()); LogLog.warn(new SimpleDateFormat(format).format(new Date()) + " [" + filename + "] load completed."); } }
/** This method determines if there is a sense in attempting to append. <p>It checks whether there is a set output target and also if there is a set layout. If these checks fail, then the boolean value <code>false</code> is returned. */ protected boolean checkEntryConditions() { if(this.closed) { LogLog.warn("Not allowed to write to a closed appender."); return false; } if(this.qw == null) { errorHandler.error("No output stream or file set for the appender named ["+ name+"]."); return false; } if(this.layout == null) { errorHandler.error("No layout set for the appender named ["+ name+"]."); return false; } return true; }