• Not Answered

Sitecore.Logging Appender: How to set the filename format of a log file with custom predefined properties?

1. How to set variables in Sitecore.Logging using something similar to log4net.GlobalContext.Properties?

Example:

log4net.GlobalContext.Properties["website"] = "value";   //This does not work in Sitecore.Logging

2. How to set the format of the appender file in Sitecore.Logging using something similar to log4net.Util.PatternString?

Example:

<appender name="500Appender" type="log4net.Appender.RollingFileAppender">
      <file type="log4net.Util.PatternString" value="$(datafolder)/%property{website}.log

Summary:

I need to set the format of the file name of a RollingFileAppender using custom properties such as the "website", "area", but I cannot find something similar to log4net in Sitecore.Logging.