log X-Amzn-Trace-Id to trace requests through my Application Load Balancer - AWS

0 votes
How do I log X-Amzn-Trace-Id to trace requests through my Application Load Balancer and web servers?
Oct 14, 2019 in AWS by Hannah
• 18,520 points
3,616 views
Which web service are you using?
I am using the Apache web server.

Hey use the following steps to log the X-Amzn-Trace_Id header:

1. Open the Apache configuration file ( /etc/httpd/conf/httpd.conf in Amazon Linux) in your preferred text editor.

2. In the LogFormat section, add the option %{X-Amzn-Trace-Id}i as follows:

LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Amzn-Trace-Id}i\"" combined

3. Restart the Apache service to apply your changes as follows:  

sudo service apache restart
Hey @Tanya, can you make this an answer? I will upvote it!
Sure @Kalgi :)

1 answer to this question.

+1 vote

Hey use the following steps to log the X-Amzn-Trace_Id header:

1. Open the Apache configuration file ( /etc/httpd/conf/httpd.conf in Amazon Linux) in your preferred text editor.

2. In the LogFormat section, add the option %{X-Amzn-Trace-Id}i as follows:

LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Amzn-Trace-Id}i\"" combined

3. Restart the Apache service to apply your changes as follows:  

sudo service apache restart
answered Oct 15, 2019 by Tanya

Related Questions In AWS

0 votes
1 answer

How to know which is a suitable load balancer for my application?

Like you said Elastic Load Balancing offers ...READ MORE

answered Oct 15, 2018 in AWS by Archana
• 4,170 points
1,392 views
0 votes
1 answer

Configure Application load balancer to route http to https in Elastic beanstalk

From this document: To update your Elastic Beanstalk environment to ...READ MORE

answered Sep 6, 2018 in AWS by Priyaj
• 58,020 points
2,126 views
0 votes
1 answer
+1 vote
3 answers
+1 vote
1 answer

How to make an application private on AWS Elastic Beanstalk?

Like you said by default, your application ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
2,313 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP