2

I am using async forwarding appender.

https://github.com/cjbhaines/Log4Net.Async

Below is my Configuration

<appender name="asyncForwarder" type="Log4Net.Async.AsyncForwardingAppender,Log4Net.Async">
  <bufferSize value="2000"/>
<appender-ref ref="AMQAppender" />
<appender-ref ref="RollingFileAppender" /> 

Buffer size value 2000 is not getting set and get this below warning.

Unable to set property [bufferSize] on object using value [2000] (with accepatble convresion types)

What am I doing wrong with configuration, please advise.

Esen
  • 973
  • 1
  • 21
  • 47
  • Do you get the same error using a lower value? – stuartd Jul 15 '15 at 16:02
  • yes, the datatype of buffersize is int? I am not sure if "?" (nullable) type is a problem here. – Esen Jul 17 '15 at 14:48
  • 1
    Yes, that's it, changing BufferSize to be a normal int instead of a nullable one fixes the problem: log4net's xml config type converter code cannot cope with nullables - as a workaround, you could set the buffer value in code. – stuartd Jul 17 '15 at 16:04
  • Raised https://github.com/cjbhaines/Log4Net.Async/issues/13 – stuartd Jul 17 '15 at 16:10
  • Thank you @stuartd add this as answer, I will mark it as the accepted answer. – Esen Jul 28 '15 at 20:14

1 Answers1

0

Since @stuartd didn't post his answer in answer section instead of comment and me being a person like closure. Here is the answer from stuartd:

Change buffersize to be a int instead of int?

Esen
  • 973
  • 1
  • 21
  • 47