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

Audit changes #607

Open
sebastianelsner opened this issue Sep 23, 2024 · 5 comments
Open

Audit changes #607

sebastianelsner opened this issue Sep 23, 2024 · 5 comments
Assignees
Milestone

Comments

@sebastianelsner
Copy link
Contributor

We are thinking about if it may be worth adding a audit system to afanasy server, which records in a text file all the changes that were done manually in the UI or via any tool on a job, a branch etc.

@timurhai What would be the best way to go about this? can you point me into a direction in the source code which is most central to capture this info? Maybe I can then build it myself.

@timurhai
Copy link
Member

Hello! Sorry for a delay.
Each node has a log and a method to add line to it.
Any change produces a line of log.
By default node keeps 100 lines (af_node_log_lines_max).
The method, can add same line to some file.
But there should be some mechanism to rotate log files and delete old.

@sebastianelsner
Copy link
Contributor Author

Ok, this helps. Additional questions: What is the best place to call the appendLog() if i want to log for example:

"job XXX priority changed from X to Y by user Z"?

@timurhai
Copy link
Member

timurhai commented Oct 8, 2024

There is already AfNodeSrv::appendLog function that called on each change (action).
We can add some static function to log all nodes in one file (and file rotation).

@timurhai
Copy link
Member

Hello!
There already store statistics in SQL database.
May be it should use SQL to log all changes too?
And database engine will process storing, clearing, searching?

@sebastianelsner
Copy link
Contributor Author

Yes, sure I can totally imagine this being in the database.

@timurhai timurhai self-assigned this Dec 23, 2024
@timurhai timurhai added this to the 3.4.0 milestone Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants