Program.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using GSG.NET.Logging;
  2. using GSG.NET.Utils;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. namespace PLCLogger
  9. {
  10. static class Program
  11. {
  12. static Logger logger = Logger.GetLogger();
  13. /// <summary>
  14. /// 해당 애플리케이션의 주 진입점입니다.
  15. /// </summary>
  16. [STAThread]
  17. static void Main()
  18. {
  19. if (!ProcessUtils.IsOnlyOneInstance)
  20. {
  21. MessageBox.Show("{PLC Logger is running duplicate");
  22. return;
  23. }
  24. LogUtils.Configure("Config/log4net.xml", true);
  25. AppUtils.LogGlobalException();
  26. logger.I("{0} PLC Logger Started {0}", string.Empty.PadRight(40, '+'));
  27. try
  28. {
  29. Application.EnableVisualStyles();
  30. Application.SetCompatibleTextRenderingDefault(false);
  31. Application.Run(new Form1());
  32. }
  33. catch (Exception e)
  34. {
  35. logger.E(e);
  36. }
  37. logger.I("{0} PLC Logger Stopped {0}", string.Empty.PadRight(40, '-'));
  38. }
  39. }
  40. }