OCPPLogFactory.cs 876 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. 
  2. using SuperSocket.SocketBase;
  3. using SuperSocket.SocketBase.Logging;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace OCPPServer.SubProtocol
  11. {
  12. /// <summary>
  13. /// OCPP log factory
  14. /// </summary>
  15. public class OCPPLogFactory : LogFactoryBase
  16. {
  17. public OCPPLogFactory() : this("NLog.config")
  18. {
  19. }
  20. public OCPPLogFactory(string log4netConfig)
  21. : base(log4netConfig)
  22. {
  23. List<string> configlist = new List<string>();
  24. configlist.Add(ConfigFile);
  25. NLog.Config.XmlLoggingConfiguration.SetCandidateConfigFilePaths(configlist);
  26. }
  27. public override SuperSocket.SocketBase.Logging.ILog GetLog(string name)
  28. {
  29. return new OCPPLog(name);
  30. }
  31. }
  32. }