I have a wrapper class for log4net to log across multiple classes and assemblies within a group of dll-libraries. (This may be poor design, but.. don't ask) The code basically looks like this:
public static class Logger
{
private static ILog log;
static Logger()
{
log = LogManager.GetLogger("abcd");
XmlConfigurator.Configure(new FileInfo("LoggerConfig.log4net"));
log.Info("=== NEW SESSION ===");
}
public static void Log(string message)
{
log.Debug(message);
}
}
Now.. if the static constructor was the static main routine of a simple executable, this works perfectly fine (I quickly made a console app to test it). But here it does not. Since I deal with standalone assemblies, not executables, the only way I can easily test the logger is through MSTest. This may be a cause for this problem. I am not 100% sure if it maybe simply can't find the config file. It is copied at compilation and lies in the same folder as the assembly containing the logger class, so i think that should work.
bleh.. stuck since three hours. :T any suggestions?