How to generate site specific log file in multi site scenario?

By default only one log file is created in multi-site scenario also.

We have come across requirement to generate log file as per site i.e. each site have its own log file.

Example log.site1.20190702.152425.txt log.site1.20190702.152425.txt

Is this requirement feasible?

If any custom implementation, Please illuminate on custom approach.


I am using Sitecore 9.2. 

  • We have this scenario, create a extended class where you read the and use that to decide which log file to write. Also, for maintaining new log file, you have to add configuration to enable sitecore to do the same.