'Microsoft.Practices.EnterpriseLibrary.Logging Log File not generated

I am using Microsoft.Practices.EnterpriseLibrary.Logging "6.0.1304.0" in my application. I have 2 listeners configured for them (FlatFileTraceListenerData and FormattedEventLogTraceListenerData).

This is working fine in my local application. It creates log file and it adds the log entry and it creates entry in Event Viewer also as expected.

When i move this to my server (DEV environment), Log file is not generated and event viewer also not created.

I have checked all the aspects (config, folder availability, folder permission given to full control to "System, NetWork, NetWork Service and Application pool identitly")

I am not understanding what is missing to generate the file and entry in event viewer.

Does anyone have any suggestion on this?

Below is my configuration

<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
    <listeners>     
        
        <add name="Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="C:\Log\EntLibLogDetails.log" formatter="Text Formatter"/>
        
        <add name="Event Log Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" source="EBIZ Sitecore" formatter="Text Formatter" log="Application" traceOutputOptions="None" filter="All"/>
    </listeners>
    <formatters>
        <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}" name="Text Formatter"/>
    </formatters>
    <categorySources>
        <add switchValue="All" name="General">
            <listeners>                 
                <add name="Event Log Trace Listener" />
                <add name="Flat File Trace Listener" />
            </listeners>
        </add>
        <add switchValue="All" name="Exception">
            <listeners>                 
                <add name="Event Log Trace Listener" />
                <add name="Flat File Trace Listener" />
            </listeners>
        </add>
        <add switchValue="All" name="Trace">
            <listeners>                 
                <add name="Event Log Trace Listener" />
                <add name="Flat File Trace Listener" />
            </listeners>
        </add>
        <add switchValue="All" name="Info">
            <listeners>                 
                <add name="Event Log Trace Listener" />
                <add name="Flat File Trace Listener" />
            </listeners>
        </add>
    </categorySources>
    <specialSources>
        <allEvents switchValue="All" name="All Events" />
        <notProcessed switchValue="All" name="Unprocessed Category" />
        <errors switchValue="All" name="Logging Errors &amp; Warnings">
            <listeners>                 
                <add name="Event Log Trace Listener" />
                <add name="Flat File Trace Listener" />
            </listeners>
        </errors>
    </specialSources>
</loggingConfiguration>
<exceptionHandling>
    <exceptionPolicies>
        <add name="Global Policy">
            <exceptionTypes>
                <add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow">
                    <exceptionHandlers>
                        <add name="Logging Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" logCategory="Exception" eventId="100" severity="Error" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling" priority="0" />
                    </exceptionHandlers>
                </add>
            </exceptionTypes>
        </add>
    </exceptionPolicies>
</exceptionHandling>


Solution 1:[1]

If I understood your issue correctly, the following code should help you:

path = "my/python/is/working"
list = ["abcd.txt","efgh.txt","ijkl.txt"]
path_of_each_file = [path + "\\" + x for x in list]

for i in range(len(path_of_each_file)):
    print(os.path.basename(path_of_each_file[i]))

Output:

abcd.txt
efgh.txt
ijkl.txt

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Md Abrar Jahin