Having been accused of doing things the hard way I need a sanity check here. All I want to do is add an additional column to the logging database to account for Application ID and have this value read in from the config file.
I created a new class ExtLogEntry that extends the LogEntry object that is merely get/set for my new field Application
I added the column and modified the stored procedure. The WriteLog stored proc works with no issues.
I understand that I cannot inherit from anything other than the CustomTraceListener so I have. I have overridden the Write methods and added custom code to call the stored proc with the additional parm. Here starts my questions/dilemma
1. The database trace listener wraps up things like the database name, stored proc name into the listener declaration. This is nice and tidy for reuse. Do I really have to abandon this? I need to get the database name, stored proc
name, & application name (new field) from somewhere. At a previous company a developer hacked the source code to take app name but I'm trying hard not to.
2. One of the web examples I found overrides TraceData. I don't have the source code but I can see that it is called in the Logger.Write pipeline before the actual write method. Curious what its intent was
3. If I do have to pull in my dbName, Stored Proc name, and application name from a seperate part of my config file where do you store this info?
Thanks. For what I am tryind to do, the level of effort is totally disproportionate and I can't believe I am on the right track.