We run 4 different applications in their own environments on Elastic Beanstalk. 2 of them are Java servers and 2 of them are golang servers. When the applications have been created we have selected the platform depending on the running apps.
If i check out the logs in any of them, either last 100 or full logs, I get web-1.log
and web-1.error.log
for all of the applications with the the logs properly logged.
However, if I enable log streaming for all the applications then only our Java applications actually start streaming the app logs to CloudWatch. For our go application we get the log groups:
/aws/elasticbeanstalk/<go-server-app-name>/var/log/eb-activity.log 3 days - - -
/aws/elasticbeanstalk/<go-server-app-name>/var/log/nginx/access.log 3 days - - -
/aws/elasticbeanstalk/<go-server-app-name>/var/log/nginx/error.log 3 days - - -
whereas for the java applications we get
/aws/elasticbeanstalk/<java-server-app-name>/var/log/eb-activity.log 1 week - - -
/aws/elasticbeanstalk/<java-server-app-name>/var/log/nginx/access.log 1 week - - -
/aws/elasticbeanstalk/<java-server-app-name>/var/log/nginx/error.log 1 week - - -
/aws/elasticbeanstalk/<java-server-app-name>/var/log/web-1.error.log 1 week - - -
/aws/elasticbeanstalk/<java-server-app-name>/var/log/web-1.log 1 week - - -
So the exact logs I need are omitted in the log stream for our go applications.
After searching around I found something about the format of the actual logs. The java servers logs on the format:
2022-01-21 13:22:38.446 => TAG: msg
while the golang servers differ, one of them had NO timestamp, simply logged a message, while the other logged in json with a bunch of fields where one included the time. With that in mind I updated the logging of one of the golang apps so it created logs similar to the java apps:
2022-01-21 13:22:38.446 => log_message
I deployed it and made sure it created logs like that. After this I enabled log streaming but still the same issue. I'm thinking however that perhaps my older non-timestamped logs could somehow still mess things up or something.
Any ideas?