You don't need to do anything. The CBS.log file is generated automatically by the Windows Installer Module service.
You will find the log at:
C:\Windows\System\Logs\CBS\CBS.log
The most recent events will be found in the file named CBS.log. Each time the Windows Modules Installer service is started (e.g. at system startup) the current CBS.log file is compressed in a CbsPersist_<timestamp>.cab
file. These archives are saved in the same folder.
Note that other functions such as System Restore also write events to the CBS log file.
Interesting side note: Sometimes the CBS.log archive process fails when Windows attempts to compress it but runs into the 2 GB CAB file size limit. If this happens, it can lead to exhaustion of all free space on the system drive because the log archive process will run repeatedly, generating hundreds of 128 MB temp files which eventually fill up the drive. (If this ever happens to you, this answer explains how to fix the problem.)