I was able to achieve.
Created Azure Service with a working role (target infrastructure: .NET Framework 4.5.2) and added the installed log4net version 2.0.7 to the working role.
The following section configuration has been added for log4net, as indicated in app.config.
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
and log4net look like this.
<log4net> <appender name="AzureTraceAppender" type="log4net.Appender.TraceAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%logger - %message%newline"/> </layout> </appender> <root> <level value="ALL"/> <appender-ref ref="AzureTraceAppender"/> </root> </log4net>
So far, everything I have done is exactly the same as what you configured in your configuration file.
Configured log4net in the first line of the OnStart method WorkerRole.cs
log4net.Config.XmlConfigurator.Configure();
Create a registrar for the working role as the next at the class level in WorkerRole.c
private readonly ILog logger = LogManager.GetLogger("WorkerRole");
Trial logging information in OnStart, OnStop, Run, and RunAsync methods.
//In OnStart logger.Info("From log4net : WorkerRole1 has been started"); //In OnStop logger.Info("From log4net : WorkerRole1 has stopped"); //In Run logger.Info("WorkerRole1 is running"); //In RunAsync logger.Info("From log4net : Working");
Running WorkerRole, pointing to a Development Storate account, displays the log entries in the output window as follows. To distinguish between entries recorded in Trace, I prefix entries using "From log4net:".
WorkerRole: WorkerRole - From log4net : WorkerRole1 has been started WaWorkerHost.exe Information: 0 : From log4net : WorkerRole1 is running WorkerRole: WorkerRole - From log4net : Working

I think the part that might not be in your code might be setting up log4net in OnStart . When I deleted the line log4net.Config.XmlConfigurator.Configure(); from the OnStart method, it stopped showing log4net entries in the output window.