ptv-logistics/Log4ALA

Problems reading settings from log4net.xml

Closed this issue · 2 comments

I'm using Log4ALA and have been very happy with it.

I have one issue, however. I've uncommented some of the settings in the log4net.config file in the test application. When I do this with values containing integers I get a message saying "log4net: WARN Unable to set property [batchNumItems] on object [Log4ALA.Log4ALAAppender] using value [50] (with acceptable conversion types)"

I stepped through the code and did some research. It looks like the log4net XMLConfigurator does not treat nullable variables the same as non-nullable. Since BatchNumItems is defined in the Library as an int? the configurator throws this warning and does not set the value as expected.

I can work around this by setting the values in the appender in my code or via App settings.

It would be ideal if we could use these values in the config file as documented though.

Any thoughts (including the possibility of user error on my part) would be helpful.

Hi @bknabel,

Problems reading settings from log4net.xml is fixed with version Log4ALA 2.3.6

Thank you for the fast response!