There is no mechanism for writing custom logging in ArcGIS Portal Logs, I've raised a case https://my.esri.com/#/support/cases/02534988 for my requirement.
Something similar to Custom ArcGIS Server Logging.
https://enterprise.arcgis.com/en/sdk/latest/windows/652a31ce-4f02-43b5-bba9-9db26ce231af.html#logmes...
Custom Logging should be available from Python API at least.