Hello,
I am building a web service application in which i will have to
implement logging based on user id. My question is where do i store the user
ids? Since the nature of this problem is so dynamic, in the sense the number
of users for whom the logging will be turned on may vary from 0 to N from
point to point. Though i have couple of solutions to adress this problem i
have my concerns about the effiencency. Please advise.
Solution 1: The obvious solution is to store the user id's in the Web.config
as a comma seperated string and before logging check for the user ids and
then perform logging. With this approach i may end up changing the
Web.config in the production machine and i am not aware of its consequences.
I rememeber reading an article that changing the web.config is a not a good
idea though it did not elaborate the reasons and the outcome of it.
Solution 2 : Implement a polling mechanism to constantly check the database
for the list of users for whom the logging is enabled. The down side of it
is creating connection objects which means consuming resources and also the
polling would continue even if there are no users for logging. Also it is
pretty hard to guess a interval for polling because of the nature of the
problem. if i choose a very small interval there will be an unessecary
overhead and if i choose a large value i will have to wait for that time
untill the logging begins.
I will be really glad if you advise me as to how to go about this.
Thanks
Bala