Refine search
public static Logger getLogger() { return LogUtils.getL7dLogger(RPCCXFServlet.class); }
public static String getKeystoreProvider(String keyStoreProvider, Logger log) { String logMsg = null; if (keyStoreProvider != null) { logMsg = "KEY_STORE_PROVIDER_SET"; } else { keyStoreProvider = SystemPropertyAction.getProperty("javax.net.ssl.keyStoreProvider", null); if (keyStoreProvider == null) { logMsg = "KEY_STORE_PROVIDER_NOT_SET"; } else { logMsg = "KEY_STORE_PROVIDER_SYSTEM_SET"; } } LogUtils.log(log, Level.FINE, logMsg, keyStoreProvider); return keyStoreProvider; }
/** * Get a Logger with an associated resource bundle. * * @param cls the Class to contain the Logger * @param resourcename the resource name * @return an appropriate Logger */ public static Logger getL7dLogger(Class<?> cls, String resourcename) { return createLogger(cls, resourcename, cls.getName()); }
(AddressingProperties)message.get(mapProperty); if (maps == null && isOutbound && !isRequestor && message.getExchange() != null && message.getExchange().getInMessage() != null) { maps = (AddressingProperties)message.getExchange().getInMessage().get(mapProperty); LOG.log(Level.FINE, "current MAPs {0}", maps); } else if (!isProviderContext) { LogUtils.log(LOG, warnIfMissing ? Level.WARNING : Level.FINE, "MAPS_RETRIEVAL_FAILURE_MSG");
FaultInfo faultWanted = null; MessagePartInfo part = null; BindingOperationInfo boi = msg.getExchange().get(BindingOperationInfo.class); if (boi == null) { return; return; Service s = msg.getExchange().get(Service.class); DataBinding dataBinding = s.getDataBinding(); msg.setContent(Exception.class, e); } catch (Exception e1) { LogUtils.log(LOG, Level.INFO, "EXCEPTION_WHILE_CREATING_EXCEPTION", e1, e1.getMessage());
private void doDefaultLogging(Message message, Exception ex, StringBuilder description) { FaultMode mode = message.get(FaultMode.class); if (mode == FaultMode.CHECKED_APPLICATION_FAULT) { if (isFineLogging) { LogUtils.log(LOG, Level.FINE, "Application " + description + "has thrown exception, unwinding now", ex); LogUtils.log(LOG, Level.INFO, "Application " + description + "has thrown exception, unwinding now: " LogUtils.log(LOG, Level.WARNING, "Application " + description + "has thrown exception, unwinding now", ex); } else { LogUtils.log(LOG, Level.WARNING, "Interceptor for " + description + "has thrown exception, unwinding now", ex);
Logger getMessageLogger(Message message) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null || ep.getEndpointInfo() == null) { return getLogger(); } EndpointInfo endpoint = ep.getEndpointInfo(); if (endpoint.getService() == null) { return getLogger(); } Logger logger = endpoint.getProperty("MessageLogger", Logger.class); if (logger == null) { String serviceName = endpoint.getService().getName().getLocalPart(); InterfaceInfo iface = endpoint.getService().getInterface(); String portName = endpoint.getName().getLocalPart(); String portTypeName = iface.getName().getLocalPart(); String logName = "org.apache.cxf.services." + serviceName + "." + portName + "." + portTypeName; logger = LogUtils.getL7dLogger(this.getClass(), null, logName); endpoint.setProperty("MessageLogger", logger); } return logger; }
protected void handle(Message msg) throws SequenceFault, RMException { AddressingProperties maps = ContextUtils.retrieveMAPs(msg, false, true, false); if (null == maps) { LogUtils.log(LOG, Level.WARNING, "MAPS_RETRIEVAL_FAILURE_MSG"); return; if (Boolean.TRUE.equals(msg.get(RMMessageConstants.RM_RETRANSMISSION))) { return; if (isPartialResponse && rmpsOut.getAcks() != null && rmpsOut.getAcks().size() > 0) { setAction(maps, constants.getSequenceAckAction()); msg.remove(Message.EMPTY_PARTIAL_RESPONSE_MESSAGE); isAck = true;
public void handleMessage(Message msg) throws Fault { try { handle(msg); } catch (SequenceFault sf) { // log the fault as it may not be reported back to the client Endpoint e = msg.getExchange().getEndpoint(); Binding b = null; if (null != e) { b = e.getBinding(); } if (null != b) { RMManager m = getManager(); LOG.fine("Manager: " + m); BindingFaultFactory bff = m.getBindingFaultFactory(b); Fault f = bff.createFault(sf, msg); // log with warning instead sever, as this may happen for some delayed messages LogUtils.log(LOG, Level.WARNING, "SEQ_FAULT_MSG", bff.toString(f)); throw f; } throw new Fault(sf); } catch (RMException ex) { throw new Fault(ex); } }
public static File createTmpDir() { int x = (int)(Math.random() * 1000000); String s = SystemPropertyAction.getProperty("java.io.tmpdir"); File checkExists = new File(s); if (!checkExists.exists() || !checkExists.isDirectory()) { LogUtils.getL7dLogger(FileUtils.class).warning("The directory " + s + " has very " + "little usable temporary space. Operations" + " requiring temporary files may fail.");
private void initializeViaInitMethod(Handler<?> handler, Map<String, String> params, Method init) { try { init.invoke(handler, params); } catch (InvocationTargetException ex) { Throwable t = ex.getCause() != null ? ex.getCause() : ex; LogUtils.log(LOG, Level.WARNING, "INIT_METHOD_THREW_EXCEPTION", t, handler.getClass()); } catch (IllegalAccessException ex) { LOG.log(Level.SEVERE, "CANNOT_ACCESS_INIT", handler.getClass()); } }
/** * Allows both parameter substitution and a typed Throwable to be logged. * * @param logger the Logger the log to * @param level the severity level * @param message the log message * @param throwable the Throwable to log * @param parameter the parameter to substitute into message */ public static void log(Logger logger, Level level, String message, Throwable throwable, Object parameter) { if (logger.isLoggable(level)) { final String formattedMessage = MessageFormat.format(localize(logger, message), parameter); doLog(logger, level, formattedMessage, throwable); } }
String name, String loggerName) { ClassLoader orig = getContextClassLoader(); ClassLoader n = getClassLoader(cls); if (n != null) { setContextClassLoader(n); } finally { if (n != orig) { setContextClassLoader(orig);
ClassLoader n = cls.getClassLoader(); if (n != null) { setContextClassLoader(n); } finally { if (n != orig) { setContextClassLoader(orig);
(AddressingProperties)message.get(mapProperty); if (maps == null && isOutbound && !isRequestor && message.getExchange() != null && message.getExchange().getInMessage() != null) { maps = (AddressingProperties)message.getExchange().getInMessage().get(mapProperty); LOG.log(Level.FINE, "current MAPs {0}", maps); } else if (!isProviderContext) { LogUtils.log(LOG, warnIfMissing ? Level.WARNING : Level.FINE, "MAPS_RETRIEVAL_FAILURE_MSG");
FaultInfo faultWanted = null; MessagePartInfo part = null; BindingOperationInfo boi = msg.getExchange().get(BindingOperationInfo.class); if (boi == null) { return; return; Service s = msg.getExchange().get(Service.class); DataBinding dataBinding = s.getDataBinding(); msg.setContent(Exception.class, e); } catch (Exception e1) { LogUtils.log(LOG, Level.INFO, "EXCEPTION_WHILE_CREATING_EXCEPTION", e1, e1.getMessage());
private void doDefaultLogging(Message message, Exception ex, StringBuilder description) { FaultMode mode = message.get(FaultMode.class); if (mode == FaultMode.CHECKED_APPLICATION_FAULT) { if (isFineLogging) { LogUtils.log(LOG, Level.FINE, "Application " + description + "has thrown exception, unwinding now", ex); LogUtils.log(LOG, Level.INFO, "Application " + description + "has thrown exception, unwinding now: " LogUtils.log(LOG, Level.WARNING, "Application " + description + "has thrown exception, unwinding now", ex); } else { LogUtils.log(LOG, Level.WARNING, "Interceptor for " + description + "has thrown exception, unwinding now", ex);
Logger getMessageLogger(Message message) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null || ep.getEndpointInfo() == null) { return getLogger(); } EndpointInfo endpoint = ep.getEndpointInfo(); if (endpoint.getService() == null) { return getLogger(); } Logger logger = endpoint.getProperty("MessageLogger", Logger.class); if (logger == null) { String serviceName = endpoint.getService().getName().getLocalPart(); InterfaceInfo iface = endpoint.getService().getInterface(); String portName = endpoint.getName().getLocalPart(); String portTypeName = iface.getName().getLocalPart(); String logName = "org.apache.cxf.services." + serviceName + "." + portName + "." + portTypeName; logger = LogUtils.getL7dLogger(this.getClass(), null, logName); endpoint.setProperty("MessageLogger", logger); } return logger; }
public static File createTmpDir(boolean addHook) { String s = SystemPropertyAction.getProperty("java.io.tmpdir"); File checkExists = new File(s); if (!checkExists.exists() || !checkExists.isDirectory()) { LogUtils.getL7dLogger(FileUtils.class).warning("The directory " + s + " has very " + "little usable temporary space. Operations" + " requiring temporary files may fail.");
private Socket enableCipherSuites(Socket s, Object[] logParams) { SSLSocket socket = (SSLSocket)s; if (socket == null) { LogUtils.log(LOG, Level.SEVERE, "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", logParams); return socket; } if (protocol != null) { String[] p = findProtocols(protocol, socket.getSupportedProtocols()); if (p != null) { socket.setEnabledProtocols(p); } } if (ciphers != null) { socket.setEnabledCipherSuites(ciphers); } return socket; } private String[] findProtocols(String p, String[] options) {