How to Continuously Log Process Changes on a Linux System Using Built-in Tools?

I have root access to a Linux system and need to log processes without installing any additional software, using only built-in tools like top. However, I want the process to run in the background continuously until I manually stop it, unlike top which only shows real-time data.

Here’s what I need:

  1. When the command is executed, it should capture the initial state of all running processes.

  2. If any new process spawns or an existing process terminates, the log should capture the timestamp, the command, and user info for those changes.

  3. When I stop the logging, it should also record the final state of the processes at that moment.

How can I achieve this using built-in Linux tools?