Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have implemented log4net in wcf service and using eventlogappender, its all working good in development region, when I deploy to test environment, eventlogappender is not working, but smtp appender is working fine in test environment. I searched online for solution and came across permission problem, I gave Network Service, Anonymous Logon, IIS worker process full rights to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog folder. But still it not logging

I followed log4net internal logging.
HTML
<appsettings>
        <add key="log4net.Internal.Debug" value="true" />
    </appsettings>

<system.diagnostics>
        <trace autoflush="true">
            <listeners>
                <add>
                    name="textWriterTraceListener" 
                    type="System.Diagnostics.TextWriterTraceListener" 
                    initializeData="C:\tmp\log4net.txt" />
            </add></listeners>
        </trace>
    </system.diagnostics>


When I deployed to test system with updated config. it never wrote to that file. I also gave same permissions to that file.
Posted
Updated 27-Nov-13 5:33am
v2

1 solution

Solved, I created a console application to create event source and ran it as an administrator, it created event source and then I restarted IIS to have to changes. It worked. So it needs an installer to do all these.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900