private static String lookupPort ( Properties props ) { String port = null ; // 1. lookup system property 'td.logger.api.server.port' if ( props . containsKey ( Config . TD_LOGGER_API_SERVER_PORT ) ) { port = props . getProperty ( Config . TD_LOGGER_API_SERVER_PORT ) ; } // if not exists, set defualt value if ( port == null ) { port = Config . TD_LOGGER_API_SERVER_PORT_DEFAULT ; } // write/overwrite it to 'td.api.server.port' props . setProperty ( Config . TD_API_SERVER_PORT , port ) ; return port ; }
Define order for port num lookup . 1 . lookup props s td . logger . api . server . port