Scenario
I have a non-static class that wraps around Log4Net. This is very convenient because it is connected to another application that I have, which displays the logs of various processes that occur in a variety of software that I write (so that I can see where errors occur, batch processes fail, etc.) d.).
Problem
This is good and good, but if I want to register the whole process, I have to do a number of things:
- Create an instance of the logging object.
- Tell it to start.
- Register the material.
- Tell him to stop.
This means that if the process runs outside the class, I have to get confused about going through the Logging object, around which the pain arises, and looks messy.
Question
How can I simply declare an object in such a way that it is globally accessible for all classes ... ... and make it static, itโs not really an option, I donโt think so.
..... It may be a waste of time, but I like the opinions.
source share