Java slf4j Logger parsePortNumber(String port, int defaultPort)

Here you can find the source of parsePortNumber(String port, int defaultPort)

Description

parse Port Number

License

Open Source License

Declaration

static int parsePortNumber(String port, int defaultPort) 

Method Source Code

//package com.java2s;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    static final Logger LOGGER = LoggerFactory
            .getLogger("com.force.sdk.connector");

    static int parsePortNumber(String port, int defaultPort) {
        int proxyPort = defaultPort;
        if (port != null) {
            try {
                proxyPort = Integer.parseInt(port);
            } catch (NumberFormatException ne) {
                LOGGER.warn("Unable to parse port '" + port
                        + "'. Using default port number " + defaultPort, ne);
            }/*from   ww  w. j  a va 2 s .c o  m*/
        }

        return proxyPort;
    }
}

Related

  1. logResult(long time, String traceId, String apiName, String params, String jsonObject)
  2. logThreadGroup(final Logger log, ThreadGroup group, int level)
  3. logThrowable(Throwable throwable)
  4. logWarningWithDebugDetails(Logger logger, Throwable t, String message, Object... values)
  5. notNull(String message, Object obj)
  6. printInfoLog(Class cla, String message)
  7. printPrettyJson(Logger logger, String json)
  8. printRequestLog(Map reqParam)
  9. printResponseLog(String res)