I'm writing a program and writing my own logging at the moment but I would like to start using a library. Does the common logging library in C# allow for 1 logger that is shared globally? I have multiple classes and I would like them all to log into 1 file without passing some reference of the logger into each class. Also would this be good practice if possible?
class myclass1{
//declare logger here...
funca() {
log("run status");
myclass2 mc = new myclass();
mc.funcb();
}
}
another file.
class myclass2{
funcb() {
//don't need to pass logger reference just log here.
log("run status");
}
}