KeDeng has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21613 )

Change subject: [log] Support logging audit logs to a separate file
......................................................................


Patch Set 7:

(3 comments)

Thanks for your reviews.

http://gerrit.cloudera.org:8080/#/c/21613/5//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/21613/5//COMMIT_MSG@19
PS5, Line 19:
            : Currently
> I might be missing something, but don't see how that would happen with this
With the help of this patch, if I execute a deletion of a table named 
`dk_test`, I will see the following printout in `kudu-master.INFO`:

```
I20240826 15:59:22.350466  1965 catalog_manager.cc:2463] Servicing 
SoftDeleteTable request from {username='kudu', 
principal='kudu/hybrid01.classic-tx-beijing-01.org-sep-api-1724653037.deploy.sensorsdata.cloud@SENSORSDATA'}
 at 10.1.136.208:37857:
table { table_name: "dk_test" } modify_external_catalogs: true
I20240826 15:59:22.350538  1965 catalog_manager.cc:2647] Servicing DeleteTable 
request from {username='kudu', 
principal='kudu/hybrid01.classic-tx-beijing-01.org-sep-api-1724653037.deploy.sensorsdata.cloud@SENSORSDATA'}
 at 10.1.136.208:37857:
table { table_name: "dk_test" } modify_external_catalogs: true
```

This behavior is the same as without the patch. However, in addition to this, 
we will also get the above output recorded in a log file named something like 
`kudu-master.hybrid01.kudu.AuditLog.20240826-155922.0.1641`. This `*AuditLog*` 
file will only contain audit-related logs. Given this, its content is refreshed 
separately, which can be helpful when needed.


http://gerrit.cloudera.org:8080/#/c/21613/6/src/kudu/master/audit_logger.h
File src/kudu/master/audit_logger.h:

http://gerrit.cloudera.org:8080/#/c/21613/6/src/kudu/master/audit_logger.h@126
PS6, Line 126: te audit log file in addition to appearing in the regula
> the separate audit log file
Done


http://gerrit.cloudera.org:8080/#/c/21613/6/src/kudu/master/audit_logger.cc
File src/kudu/master/audit_logger.cc:

http://gerrit.cloudera.org:8080/#/c/21613/6/src/kudu/master/audit_logger.cc@59
PS6, Line 59:
> OK, once switched to detecting the program name and evaluating 'program_nam
I have updated the implementation and tested it in a real environment. It does 
indeed generate a file named 
`kudu-master.hybrid01.kudu.AuditLog.20240826-155922.0.1641`.



--
To view, visit http://gerrit.cloudera.org:8080/21613
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5323361befb456d91a12da7273865542f1d2430
Gerrit-Change-Number: 21613
Gerrit-PatchSet: 7
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <[email protected]>
Gerrit-Comment-Date: Mon, 26 Aug 2024 08:18:54 +0000
Gerrit-HasComments: Yes

Reply via email to