Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Traffic Ops username to access log #642

Closed
wants to merge 1 commit into from

Conversation

rob05c
Copy link
Member

@rob05c rob05c commented Jun 5, 2017

No description provided.

@mitchell852
Copy link
Member

Tested locally, here were my results:

127.0.0.1 - localUsername [05/Jun/2017:13:38:48 -0600] "GET /api/1.2/logs/newcount HTTP/1.1" 200 51 7370 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"

^^ local database user

127.0.0.1 - ldapUsername [05/Jun/2017:13:39:07 -0600] "GET /newlogcount HTTP/1.1" 200 38 4830 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"

^^ ldap user (user is not found in the database)

@dewrich or @dangogh - any concerns?

@dewrich
Copy link
Contributor

dewrich commented Jun 5, 2017

I think putting the username at the "end" of the line is better in case there are any logs scrapers concerned with that format. Otherwise I think the localUsername vs. the ldapUsername seems correct to be logged accordingly.

@rob05c
Copy link
Member Author

rob05c commented Jun 5, 2017

This PR doesn't modify the log format, which was already logging %u (which apparently broke sometime in the past), it only makes the logger aware of the username.

@mitchell852
Copy link
Member

mitchell852 commented Jun 6, 2017

this is what the log line looks like now:

127.0.0.1 - - [05/Jun/2017:13:54:34 -0600] "GET /api/1.2/logs/newcount HTTP/1.1" 200 51 25823 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"

so, yea, @dewrich it looks like the %u is there...it's just blank...

@asfgit asfgit closed this in f0b59cf Jun 8, 2017
rob05c pushed a commit to rob05c/trafficcontrol that referenced this pull request Jul 11, 2017
@rob05c rob05c deleted the to-logusers branch November 13, 2017 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants