Hi everyone,
we have a problem on our aspnet webapplication, in which we use mongodb only from the log4net mongodb appender.
if our instance of mongodb goes down (for whatever cause), the requests to our webapplication start to hang. if the mongodb instance goes up again, then the pending requests are fullfilled.
It's like the logging elaboration is on the request's thread, so if the appender cannot communicate with the mongodb instance, then the entire request waits (until a network timeout occurs).
Is that hypotesis correct?
If that's the case we would like to ask if it's possible to make the appender sort of "non-blocking": if there are problems with mongodb communication, the requests continue to be fullfilled.
That's the appender configuration from our web.config:
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<appender name="SessionAppender" type="Log4Mongo.MongoDBAppender, Log4Mongo">
<connectionString value="mongodb://username:password@host/DatabaseName" />
<collectionName value="Session" />
<field>
<name value="App" />
<layout type="log4net.Layout.PatternLayout" value="%property{App}" />
</field>
<!-- ... other fields ... -->
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="SESSION" />
<levelMax value="SESSION" />
</filter>
</appender>
<appender name="AuditAppender" type="Log4Mongo.MongoDBAppender, Log4Mongo">
<connectionString value="mongodb://username:password@host/DatabaseName" />
<collectionName value="Audit" />
<field>
<name value="App" />
<layout type="log4net.Layout.PatternLayout" value="%property{App}" />
</field>
<!-- ... other fields ... -->
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="REQUEST" />
<levelMax value="RESPONSE" />
</filter>
</appender>
<appender name="TraceAppender" type="Log4Mongo.MongoDBAppender, Log4Mongo">
<connectionString value="mongodb://username:password@host/DatabaseName" />
<collectionName value="Trace" />
<field>
<name value="App" />
<layout type="log4net.Layout.PatternLayout" value="%property{App}" />
</field>
<!-- ... other fields ... -->
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="DEBUG" />
</filter>
</appender>
<appender name="SessionForwardingAppender"
type="log4net.Appender.BufferingForwardingAppender">
<bufferSize value="100"/>
<appender-ref ref="SessionAppender" /> <!-- already defined -->
</appender>
<appender name="AuditForwardingAppender"
type="log4net.Appender.BufferingForwardingAppender">
<bufferSize value="100"/>
<appender-ref ref="AuditAppender" /> <!-- already defined -->
</appender>
<appender name="TraceForwardingAppender"
type="log4net.Appender.BufferingForwardingAppender">
<bufferSize value="100"/>
<appender-ref ref="TraceAppender" /> <!-- already defined -->
</appender>
<level>
<name value="SESSION" />
<value value="1" />
</level>
<level>
<name value="REQUEST" />
<value value="2" />
</level>
<level>
<name value="RESPONSE" />
<value value="3" />
</level>
<level>
<name value="SQL" />
<value value="50000" />
</level>
<root>
<level value="ALL" />
<appender-ref ref="SessionForwardingAppender" />
<appender-ref ref="AuditForwardingAppender" />
<appender-ref ref="TraceForwardingAppender" />
</root>
</log4net>
</configuration>
Hi everyone,
we have a problem on our aspnet webapplication, in which we use mongodb only from the log4net mongodb appender.
if our instance of mongodb goes down (for whatever cause), the requests to our webapplication start to hang. if the mongodb instance goes up again, then the pending requests are fullfilled.
It's like the logging elaboration is on the request's thread, so if the appender cannot communicate with the mongodb instance, then the entire request waits (until a network timeout occurs).
Is that hypotesis correct?
If that's the case we would like to ask if it's possible to make the appender sort of "non-blocking": if there are problems with mongodb communication, the requests continue to be fullfilled.
That's the appender configuration from our web.config: