Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. private static void InitLogging()
  2. {
  3. var config = new LoggingConfiguration();
  4.  
  5. var logFile = new FileTarget("file")
  6. {
  7. FileName = "${basedir}/logs/${shortdate}.log",
  8. KeepFileOpen = true,
  9. ConcurrentWrites = false,
  10. Layout = "${longdate} - ${uppercase:${level}} - ${message}"
  11. };
  12.  
  13. config.AddRule(NLog.LogLevel.Debug, NLog.LogLevel.Fatal, logFile);
  14.  
  15. LogManager.ThrowExceptions = false;
  16. LogManager.Configuration = config;
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement