0

I use the Log4Net as my log tool, everything works really well when the test system just has a single database.

But my real system has more than one database. Different user may have the different database. I want to put the log information into different database according to the current logined user.

But so far as I know. It seems that the Log4Net does't support this topic. It seems the log4Net is configured just "once" in the lifetime.

Is it possible for me to make the log4net select database configuration basing on my information on the fly.

Aiping He
  • 491
  • 1
  • 6
  • 10

1 Answers1

0

I found the answer:

log4net - configure using multiple configuration files

and this: http://logging.apache.org/log4net/release/manual/repositories.html

The reason I thought that Log4Net only supports one configuration is I did NOT dig. As the content of the above links said: We need to create our own repository for each configuration.

Now everything is working well, and log information goes to different databases now based on the given configuration on the fly as I expected.

Community
  • 1
  • 1
Aiping He
  • 491
  • 1
  • 6
  • 10
  • Hi good to know you found the answer. I too facing the same issue. request you to post the configuration setting for multiple database appender. thanks in advance. – Abin May 10 '16 at 13:47