Guest User

Untitled

a guest
Aug 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Why is Log4Net not recording log statements in my separate thread?
  2. private static readonly ILog Log = LogManager.GetLogger("mylog");
  3.  
  4. public static string SomeValue
  5. {
  6. get
  7. {
  8. Log.Debug("This WILL be appended to the log");
  9.  
  10. var thread = new Thread(SyncData);
  11. thread.Start();
  12.  
  13. return "the value";
  14. }
  15. }
  16.  
  17. private static void SyncData()
  18. {
  19. Log.Debug("This will NOT be appended to log");
  20.  
  21. var newLog = LogManager.GetLogger("mylog");
  22. newLog.Debug("This will also NOT be appended to the log");
  23. }
Add Comment
Please, Sign In to add comment