Search in sources :

Example 1 with ListBucketsResponse

use of software.amazon.awssdk.services.s3.model.ListBucketsResponse in project aws-doc-sdk-examples by awsdocs.

the class S3Log method main.

public static void main(String[] args) {
    System.out.println("testing logging setup for " + S3Log.class);
    Region region = Region.US_WEST_2;
    S3Client s3 = S3Client.builder().region(region).build();
    ListBucketsRequest listBucketsRequest = ListBucketsRequest.builder().build();
    ListBucketsResponse listBucketsResponse = s3.listBuckets(listBucketsRequest);
    listBucketsResponse.buckets().stream().forEach(x -> System.out.println(x.name()));
    logger.info("logging level info");
    logger.debug("logging debug stuff");
    logger.warn("logging warning");
    logger.error("logging error");
    logger.fatal("logging fatal");
}
Also used : ListBucketsResponse(software.amazon.awssdk.services.s3.model.ListBucketsResponse) ListBucketsRequest(software.amazon.awssdk.services.s3.model.ListBucketsRequest) Region(software.amazon.awssdk.regions.Region) S3Client(software.amazon.awssdk.services.s3.S3Client)

Aggregations

Region (software.amazon.awssdk.regions.Region)1 S3Client (software.amazon.awssdk.services.s3.S3Client)1 ListBucketsRequest (software.amazon.awssdk.services.s3.model.ListBucketsRequest)1 ListBucketsResponse (software.amazon.awssdk.services.s3.model.ListBucketsResponse)1