在SpringBoot上关闭AWS日志记录

7gyucuyw  于 2023-06-29  发布在  Spring
关注(0)|答案(1)|浏览(188)

我有一个恼人的错误循环在服务运行期间,这只发生在本地和它的权利,因为这个功能是不应该在本地工作。
我想关闭日志记录,但即使我尝试了几件事,仍然发生。
这是跟踪:

[ntContainer#0-4] [:] c.a.s.j.AmazonSQSMessagingClientWrapper  : AmazonClientException: getQueueUrl.
com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), WebIdentityTokenCredentialsProvider: You must specify a value for roleArn and roleSessionName, com.amazonaws.auth.profile.ProfileCredentialsProvider@5a472e9d: profile file cannot be null, com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@61eee6c7: The requested metadata is not found at http://someip/latest/meta-data/iam/security-credentials/]
                at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:136) ~[aws-java-sdk-core-1.12.262.jar:na]
                at com.amazonaws.http.AmazonHttpClient$RequestExecutor.getCredentialsFromContext(AmazonHttpClient.java:1269) ~[aws-java-sdk-core-1.12.262.jar:na]
                at com.amazonaws.http.AmazonHttpClient$RequestExecutor.runBeforeRequestHandlers(AmazonHttpClient.java:845) ~[aws-java-sdk-core-1.12.262.jar:na]
                at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:794) ~[aws-java-sdk-core-1.12.262.jar:na]
                at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:781) ~[aws-java-sdk-core-1.12.262.jar:na]

我尝试在application属性中添加以下两个属性:
logging.level.com.amazonaws=OFF logging.level.c.a.s.j=OFF
再加上编辑logging.properties JDK文件,添加以下行:com.amazonaws.level = OFF
但这些都不管用。你知道吗?

9udxz4iz

9udxz4iz1#

c.a.s.j不是软件包名称,而只是一个缩短版本(由默认记录器格式缩短)->您需要使用logging.level.com.amazon.sqs.javamessaging=OFF

相关问题