예제 #1
0
        public ShawnSerilog(Action <SerilogOption> optins)
        {
            SerilogOption opt = new SerilogOption();

            optins?.Invoke(opt);
            msgTemp = opt.msgTemp;
            logger  = new SerilogFactory().Create(opt);
        }
예제 #2
0
        public ILogger Create(SerilogOption optins)
        {
            if (string.IsNullOrEmpty(optins.pathName))
            {
                var directory = AppDomain.CurrentDomain.BaseDirectory;

                optins.pathName = Path.Combine($"{directory}", "Logs", $"log.txt");
            }

            return(SerilogLoger.CreateSerilog(optins.strTempName, optins.pathName, optins.logConnectstr, optins.logTableName, optins.consoleminEvent, optins.debugminEvent, optins.fileminEvent, optins.mssminEvent, optins.columnOptions, optins.msgTemp, optins.NeedToConsole, optins.NeedToDebug, optins.NeedToMSS));
        }