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,070 points
846 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 14, 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,150 points
627 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
• 57,550 points
863 views
0 votes
1 answer
+1 vote
3 answers

Log in to AWS using Access Key ID and Secret Access Key ID

Access keys consist of an access key ...READ MORE

answered Aug 17, 2018 in AWS by Priyaj
• 57,550 points
7,956 views
+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,600 points
339 views