I
itinsley
Hi
Didn't know which group to post this in.
I am using Enterprise Library to (amongst other things) log XML
messages i receive through a Web Service. I recently had an error in my
config file declaring a Category with an incorrect name
"MessageCategory" instead of "MessagesCategory". Instead of raising an
exception when i attempted to log this message, it just did nothing
meaning that the application was running for a while without logging
any of these messages to file.
Is there any way of either:
a. finding out if a category exists from within your application
b. getting EL to raise an exception when a category doesn't exist.
I am using the following code to write the message.
LogEntry log = new LogEntry();
log.Message = message;
log.Categories.Add(logCategory);
log.Severity = severity;
Logger.Write(log);
This problem seems to me to be symptomatic of EL - that you put a huge
burden of responsibility in your configuration and as that
configuration differs in each of your environments, it is essentially
untested. So something that works fine in a test environment works
completely differently in your production environment - in this case
without even raising an exception. Does anyone have any comments on how
best to manage and reduce the risks in this area?
Didn't know which group to post this in.
I am using Enterprise Library to (amongst other things) log XML
messages i receive through a Web Service. I recently had an error in my
config file declaring a Category with an incorrect name
"MessageCategory" instead of "MessagesCategory". Instead of raising an
exception when i attempted to log this message, it just did nothing
meaning that the application was running for a while without logging
any of these messages to file.
Is there any way of either:
a. finding out if a category exists from within your application
b. getting EL to raise an exception when a category doesn't exist.
I am using the following code to write the message.
LogEntry log = new LogEntry();
log.Message = message;
log.Categories.Add(logCategory);
log.Severity = severity;
Logger.Write(log);
This problem seems to me to be symptomatic of EL - that you put a huge
burden of responsibility in your configuration and as that
configuration differs in each of your environments, it is essentially
untested. So something that works fine in a test environment works
completely differently in your production environment - in this case
without even raising an exception. Does anyone have any comments on how
best to manage and reduce the risks in this area?