TestLogging.cs 548 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using log4net.Appender;
  5. using log4net.Layout;
  6. namespace OpenSim.Tests.Common
  7. {
  8. public static class TestLogging
  9. {
  10. public static void LogToConsole()
  11. {
  12. ConsoleAppender consoleAppender = new ConsoleAppender();
  13. consoleAppender.Layout =
  14. new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline");
  15. log4net.Config.BasicConfigurator.Configure(consoleAppender);
  16. }
  17. }
  18. }