开发者

Is it possible to easily modify the log4net section in the config file of several running applications remotely?

开发者 https://www.devze.com 2022-12-28 06:18 出处:网络
Our product consists of client,开发者_高级运维 server and agents. Each deployed on different machines. The QA is having a hard time to manipulate the log4net sections in the respective config files. R

Our product consists of client,开发者_高级运维 server and agents. Each deployed on different machines. The QA is having a hard time to manipulate the log4net sections in the respective config files. Right now, they have to have remote desktops to all the relevant machines and open notepad in each of them and then edit the files one at a time switching between different machines as they proceed. A real pain in the ass.

Can anyone suggest a better solution to this problem?

Thanks.


You could store the log4net configuration in a database (you could then even consider to create a web interface that allows your QA team to modify the configuration). You have to figure out how your applications pick up the new configuration (e.g. you have some remote Admin interface that allows you to tell your applications to use the new configuration).

On start-up you load the configuration from there. Maybe it is advisable to have some backup configuration in a file that is loaded first in case loading from the database fails. The default configuration would be for instance so that the QA team gets an email if loading the configuration from the database fails.

Another option would be to store all log4net configuration files on a network share... create an application setting that tells your application where to find the log4net configuration and call the Configure() method accordingly. Again the question is how your applications pick up the new configuration.

Not sure if ConfigureAndWatch() would behave as expected if the configuration files is on a network share. If so that would be quite an easy option to implement.

0

精彩评论

暂无评论...
验证码 换一张
取 消