Use SDxServerManager.exe and the /updatetracesettings parameter. This argument will update the trace settings for a site with a specific service type.
This example updates the trace settings for a site named SDx2021.
SDxServerManager.exe /updatetracesettings /sn:SDx2021 /servicetype:[Server,LicenseService,FTRService,CacheService,ConfigService,FileService,RemoteService] /tracenamewithvalues:[Core|Information~General|Information|ALL,Warning]