Exemplo n.º 1
0
        public static void DefaultSetDestinationsProc(LogServerReceivedData data, LogServerOptions options)
        {
            FileSystem  fs       = options.DestFileSystem;
            PathParser  parser   = fs.PathParser;
            string      root     = options.DestRootDirName;
            LogPriority priority = data.JsonData !.Priority._ParseEnum(LogPriority.None);
            LogJsonData d        = data.JsonData;

            if (d.Kind._IsSamei(LogKind.Default))
            {
                if (priority >= LogPriority.Debug)
                {
                    Add($"{d.AppName}/{d.MachineName}/Debug");
                }

                if (priority >= LogPriority.Info)
                {
                    Add($"{d.AppName}/{d.MachineName}/Info");
                }

                if (priority >= LogPriority.Error)
                {
                    Add($"{d.AppName}/{d.MachineName}/Error");
                }
            }
            else
            {
                Add($"{d.AppName}/{d.MachineName}/{d.Kind}");
            }

            void Add(string filename)
            {
                data.AddDestinationFileName(parser.NormalizeDirectorySeparator(parser.Combine(root, filename + ".log")));
            }
        }
Exemplo n.º 2
0
 public LogServer(LogServerOptions options) : base(options)
 {
 }