speedwing / log4j-cloudwatch-appender

MIT License
24 stars 16 forks source link

Region is stuck as us-east-1 #6

Closed glynd closed 4 years ago

glynd commented 6 years ago

Needs an ability to set the Region

nemo83 commented 6 years ago

Not sure I fully understand. Can you give me an example of how you'd need a Region?

glynd commented 6 years ago

The AWS Logging client by default sends everything to us-east-1

If you have an application running in eu-west-1 (for example) you want to send logs to cloudwatch in eu-west-1 (not us-east-1)

See: https://github.com/aws/aws-sdk-java/issues/1221

Probable semi-fix (not tested yet)

AWSLogsClient --> AWSLogs (private AWSLogs awsLogsClient;)

this.awsLogsClient = AWSLogsClientBuilder.standard().withRegion(Regions.EU_WEST_1).build();

glynd commented 6 years ago

Obviously region should be any optional parameter to the library

nemo83 commented 6 years ago

I see now. It could be default to us-east-1 and add a property via either properties file or programmatically in code.

I could use some help if you have time.

glynd commented 6 years ago

Tested on laptop, and on an instance Allows for the getRegion() to be overridden if someone wants something different.

7