jerryshao commented on PR #4575:
URL: https://github.com/apache/gravitino/pull/4575#issuecomment-2408353688

   > > @hanwxx , appreciate for your work on audit log, we introduced 
`AuditLog` in the latest PR, and how about let `event` implement `AuditLog`, 
and the default formater could return event directly? the Pros is better 
extensibility if adding new event, no need to change default event formatter. 
WDYT? cc @jerryshao
   > > Thank you very much for reviewing the code, it is very helpful to me.
   > > In the comment, i have different idea, evnt is not  suitable as the 
default auditlog.
   > 
   > 1. AuditLog and event responsibilities are different, even though now 
audit log depend on event listener. Event focus on provide a post hook.Audit 
logs focus on persistent storage of logs.
   > 2. Provided a unified audit log schema is very important, it should be 
flat,he inheritance relationship of Event is complex.
   > 
   > In our practice, we often need to convert different events into a unified 
Audit object and finally persist it into a table for easy retrieval. In my 
design, the conversion action is necessary. The class Formatter is responsible 
for it.
   
   I kind of agree with @hanwxx , AuditLog and event are two things, we don't 
have to use interface to put them together. Using  a converter to bridge them 
together without hard combination seems better to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to