AbstractLogWriter.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:log4j-aws-appenders 作者:
/**
 *  Common support code: attempts to configure client endpoint and/or region.
 *
 *  @param  client      A constructed writer-specific service client.
 *  @param  endpoint    A possibly-null endpoint specification.
 */
protected <T extends AmazonWebServiceClient> T tryConfigureEndpointOrRegion(T client, String endpoint)
{
    // explicit endpoint takes precedence over region retrieved from environment
    if (endpoint != null)
    {
        LogLog.debug(getClass().getSimpleName() + ": configuring endpoint: " + endpoint);
        client.setEndpoint(endpoint);
        return client;
    }

    String region = System.getenv("AWS_REGION");
    if (region != null)
    {
        LogLog.debug(getClass().getSimpleName() + ": configuring region: " + region);
        client.configureRegion(Regions.fromName(region));
        return client;
    }

    return client;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号