In one initialization point of the application we init it:
And in many other locations we use it:
In one of my classes the messages I've logged did not appear in the log file (or in any of the other appenders). When I explicitly re-initialized log4net in the same class the messages were written successfully. A short investigation found the reason: This class is called from a different AppDomain than the other classes. log4net's LogManager class is static, which limits its scope to the calling AppDomain.
Conclusion: log4net needs to be initialized once per AppDomain. What's next? get this blog rss updates or register for mail updates!
0 comments:
Post a Comment