Logging does not work when hosted on IIS 7

I am using Enterprise Library 4 to log exceptions onto a flat file. Although this works like a bliss when I am directly running from the code, the log is not written when the same application is hosted on IIS (7). I have given full permissions to "Everyone"
on the directory in which the log file gets created.

Based on the posted configuration the only trace listener configured for logging is the Event Log trace listener. If you really want to log to a file then I would remove the Event Log trace listener and use the flat file trace listener for the General
category.

The likely reasons why you aren't seeing any logging is either that the log entries are actually going to the event log or the log entries are not being written to the event log due to permission issues creating the "Enterprise Library Logging" event source
registry keys (which require Administrative privilege).