Я как бы застрял в своих поисках относительно EnterpriseLibrary.Logging. У меня есть слушатель и форматирование, настроенные следующим образом:
<add name="NormalLogListener"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"
fileName="logs/MVC22.log"
footer=""
formatter="ShortLogFormatter"
header=""
rollInterval="Day"
timeStampPattern="yyyy-MM-dd"
maxArchivedFiles="14" />
...
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging"
template="{timestamp(local)} - {severity} - {category} - {message}"
name="ShortLogFormatter" />
Я использую это в нескольких проектах, и он работает нормально.
За исключением одного, я хочу, чтобы EnterpriseLibrary создавал мой файл журнала с кодировкой UTF-8 (я получаю файлы ANSI по умолчанию), но, к сожалению, я не знаю, как это сделать.
У меня есть специальные символы в строках, которые я хочу записать в свой файл (например, умляуты); Я вижу, что ведение журнала работает отлично, когда я конвертирую свой файл в UTF-8 и позволяю ему использовать его дальше, но я действительно хочу, чтобы он был создан таким образом.
Можно ли это сделать в xml-конфигурации или где-то еще?
Спасибо за любую помощь заранее!