locked
Logging to different sites to different directories RRS feed

  • Question

  • User-1984922529 posted

    We've installed the IIS advanced logging module, configured log definitions at the server root level which is all working fine. However my server has multiple sites on it. I'd like logs for each site to go to its own folder. 

    So say for instance

    Site1:
    IIS Site Name: www.domain1.com 
    Log Path: C:\inetpub\logs\AdvancedLogs\www.domain1.com\

    Site2:
    IIS Site Name: www.domain2.com
    Log Path: C:\inetpub\logs\AdvancedLogs\www.domain2.com\

    That way logs for the two sites are separated. Right now IIS advanced logging is just dumping all the logs into the same folder which makes it very difficult to differentiate which log is for which site.

    I think I could do this if I configure Advanced Logging at the individual site level but I don't want to do that for a variety of reasons:

    1) I have a complex log definition and I don't want to set it up multiple times. 
    2) As new sites get added to the server I don't want to have to manually re-set it up each time. I'd like for it to just inherit and automatically work.
    3) If I need to make a change to the definitions I know that all the sites will be updated simultaneously. There's no possibility of a single site being configured differently. 

    Is this possible? 

    Thanks
    Brad

    Monday, October 17, 2016 2:31 PM

All replies

  • User-1984922529 posted

    I found a solution - sort of. I defined log definitions at the server level - naming them "- template" and disabling them.

    Then at the individual site level I clone those disabled definitions. By doing that I assure they match the root of the server, and doing that also seems to put the logs in their own individual folder.

    Its not perfect because if the root definitions ever change I'd have to go through and re-clone them for each site but its the best solution I've been able to find. If someone can come up with something better please let me know.

    Thanks
    Brad

    Monday, October 17, 2016 3:29 PM