Say I have a class that looks like this.
public static class Config
{
public static string GetAppSetting(string key)
{
return ConfigurationManager.AppSettings[key].ToString();
}
}
And I wanted to log every call to this method along with the key parameter & return value.
The only code change I want to make is this:
[Log]
public static class Config
{
public static string GetAppSetting(string key)
{
return ConfigurationManager.AppSettings[key].ToString();
}
}
I'll most likely use log4net to log the calls from the Log attribute. How can this be achieved?
Thanks in advance!