Page MenuHomePhabricator

Implement a service call log for auditing
AbandonedPublic

Authored by epriestley on Nov 26 2013, 1:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 26, 1:16 PM
Unknown Object (File)
Tue, Dec 17, 3:26 AM
Unknown Object (File)
Fri, Dec 13, 6:09 PM
Unknown Object (File)
Oct 27 2024, 12:51 PM
Unknown Object (File)
Oct 18 2024, 9:54 PM
Unknown Object (File)
Oct 15 2024, 9:40 PM
Unknown Object (File)
Oct 2 2024, 8:20 AM
Unknown Object (File)
Sep 22 2024, 2:27 AM
Subscribers

Details

Summary

Ref T4162. This implements a global service call log, which is like a very very detailed access log.

Test Plan

See comments.

Diff Detail

Branch
servicelog
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

Here's a sample from the log:

[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	92	type=query	database=phabricator2_policy	query=SELECT * FROM `policy` WHERE phid IN ('PHID-PLCY-ihz7d5c5wf5q4ckrcdfb') 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	93	type=connect	host=localhost	database=phabricator2_draft
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	94	type=query	database=phabricator2_draft	query=SELECT * FROM `draft` WHERE authorPHID IN ('PHID-USER-lqiz3yd7wmk64ejugvov') AND draftKey LIKE 'differential-comment-%' AND draft != '' 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	95	type=query	database=phabricator2_differential	query=(SELECT r.* FROM `differential_revision` r  WHERE (r.id IN (2, 21, 40, 45, 48, 52, 54, 916, 917, 921, 933)) AND (r.id IN (933, 915, 918, 929, 927, 926, 54, 20, 48, 22, 919, 47, 52, 912, 916, 43, 46, 10, 11, 13, 14, 16, 17, 18, 19, 21, 6, 8, 9))  ORDER BY r.dateModified DESC )
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	96	type=query	database=phabricator2_repository	query=SELECT * FROM `repository` r  WHERE (r.phid IN ('PHID-REPO-d7hhxxkglcu4nzeuqv2e')) ORDER BY r.id DESC 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	97	type=query	database=phabricator2_user	query=SELECT * FROM `user` user  WHERE (user.phid IN ('PHID-USER-lqiz3yd7wmk64ejugvov', 'PHID-USER-aeabc4ipqbifny3rw4ok', 'PHID-USER-doikxnpzgkzdpwxsy2a2', 'PHID-USER-vaachy43sag5bu4vfg6q', 'PHID-USER-6nhyxe3djfdrrptyl74b', 'PHID-USER-cluwcdowc35gmperlkbi', 'PHID-USER-cknqtm2dzw7twnwyiaye', 'PHID-USER-hsklrg62naqruip5qg7h'))  ORDER BY user.id DESC 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	98	type=query	database=phabricator2_file	query=SELECT f.* FROM `file` f  WHERE (f.phid IN ('PHID-FILE-otqe72cr5lvkx2snzeyd', 'PHID-FILE-6w554dbu3u3pbkb2aluk', 'PHID-FILE-y56wprmikxjjmktzq6s4', 'PHID-FILE-iuxxahjlexgfrhoj3r23', 'PHID-FILE-ltvshr5uwkgjewzldyfw')) ORDER BY f.id DESC 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	99	type=query	database=phabricator2_file	query=SELECT edge.* FROM `edge` edge WHERE (edge.src IN ('PHID-FILE-ltvshr5uwkgjewzldyfw', 'PHID-FILE-y56wprmikxjjmktzq6s4', 'PHID-FILE-otqe72cr5lvkx2snzeyd', 'PHID-FILE-6w554dbu3u3pbkb2aluk', 'PHID-FILE-iuxxahjlexgfrhoj3r23')) AND (edge.type IN ('26')) ORDER BY edge.dateCreated DESC, edge.seq DESC
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	100	type=query	database=phabricator2_maniphest	query=SELECT task.*   FROM `maniphest_task` task  WHERE (phid in ('PHID-TASK-wmg4pbzgjaq7df3mj4y4'))   ORDER BY task.dateModified DESC 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	101	type=query	database=phabricator2_user	query=SELECT * FROM `user_status` WHERE userPHID IN ('PHID-USER-6nhyxe3djfdrrptyl74b', 'PHID-USER-cknqtm2dzw7twnwyiaye', 'PHID-USER-doikxnpzgkzdpwxsy2a2', 'PHID-USER-vaachy43sag5bu4vfg6q', 'PHID-USER-aeabc4ipqbifny3rw4ok', 'PHID-USER-hsklrg62naqruip5qg7h', 'PHID-USER-cluwcdowc35gmperlkbi', 'PHID-USER-lqiz3yd7wmk64ejugvov') AND UNIX_TIMESTAMP() BETWEEN dateFrom AND dateTo 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	102	type=query	database=phabricator2_project	query=SELECT p.* , vm.dst viewerIsMember FROM `project` p LEFT JOIN `edge` vm ON vm.src = p.phid AND vm.type = 13 AND vm.dst = 'PHID-USER-lqiz3yd7wmk64ejugvov' WHERE (phid IN ('PHID-PROJ-aeydisqcccow7zq2gzma', 'PHID-PROJ-hjjmvtd2dgkkte5tlyhe'))  ORDER BY name ASC 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	103	type=connect	host=localhost	database=phabricator2_calendar
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	104	type=query	database=phabricator2_calendar	query=SELECT * FROM `calendar_holiday` WHERE 1 = 1 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	105	type=query	database=phabricator2_calendar	query=SELECT * FROM `calendar_holiday` WHERE 1 = 1 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	106	type=connect	host=localhost	database=phabricator2_conpherence
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	107	type=query	database=phabricator2_conpherence	query=SELECT COUNT(*) as count, participantPHID FROM `conpherence_participant` participant WHERE (participantPHID IN ('PHID-USER-lqiz3yd7wmk64ejugvov')) AND (participationStatus = 1) GROUP BY participantPHID 
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	108	type=connect	host=localhost	database=phabricator2_feed
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	109	type=query	database=phabricator2_feed	query=SELECT COUNT(*) as count\n       FROM `feed_storynotification`\n       WHERE userPHID = 'PHID-USER-lqiz3yd7wmk64ejugvov' AND hasViewed = 0
[61014]	[Mon, 25 Nov 2013 17:31:53 -0800]	127.0.0.1	begin	110	type=query	database=phabricator2_file	query=SELECT * FROM `file` WHERE phid = 'PHID-FILE-ltvshr5uwkgjewzldyfw'

I profiled and verified this doesn't impact things too much (2-3 ms on most pages). I could probably shrink it down a bit more, too -- I don't think we need the "begin" column anymore.

epriestley updated this revision to Unknown Object (????).Nov 26 2013, 1:39 AM
  • Remove the "begin" column, which always says "begin".

(I'll wait for feedback about format/content on this before landing it, but don't expect to change anything substantive.)

This never moved forward.