Rolling Flat File File does not load properly

I use the Microsoft Enterprise 5 logging unit. When testing locally, all sliding flat files are created correctly and database logging in my local instance of SQL logs is as expected. The problem is when I publish my applications in a test environment. Here, when something strange happens: log files are created with strange GUID-like names. They ultimately roll, but it is very strange, and this often happens. Nor is Databse logging recorded. I could not find anything related to this problem on the Internet. I suspect authentication problems when configuring application pools and folders in IIS, but not sure. Does anyone have this problem? Here are my configuration settings:

<add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="D:\logs\MobileApps\rolling.log" formatter="Text Formatter" rollFileExistsBehavior="Increment" rollInterval="Hour" timeStampPattern="yyyy-MM-dd-hh" /> 

Files get type names

 deb7f413-6cb3-44ac-900e-02883856e82bRolling.log rolling.2012-01-19-09.log 
+4
source share
1 answer

The RollingFlatFileListener is based on the .NET Framework TextWriterTraceListener , which defines this prefix behavior: "If an attempt is made to write to a file that is used or inaccessible, the file name is automatically GUID prefixed."

You can define your own trace listener that does not allow you to open a file (for a guide on writing custom trace listeners, see Lab 2 from a set of practical laboratories on the EntLib extension ), or use the distributor service and write to the file in one place; for the latter, you need to configure MSMQ.

+3
source

Source: https://habr.com/ru/post/1391868/


All Articles