j256 / cloudwatch-logback-appender

Appender that publishes logback log entries to AWS CloudWatch
ISC License
56 stars 37 forks source link

logStream naming issue #18

Closed someCynic closed 6 years ago

someCynic commented 6 years ago

I'm using the following: <logStream>general-%{instanceName}-%{instanceId}</logStream> The reason being, that I have several docker instances with the same InstanceName for which I'd like to create separate streams for. However, In CloudWatch the stream created end up as: general-unknown-i-08887b38c3ca3.... Now, even if the name was not properly inferred, shouldn't I be seeing the instanceId twice instead of an "unknown" within the name?

j256 commented 6 years ago

Chances are the docker image has it's own network. The appender gets the instance-id from a specific IP address/web-site which I bet is not available. I'd recommend injecting the instance name into the container as an environmental variable.