Beispiel #1
0
        private void LogInit()
        {
            var msg    = "UF SDK .NET initialization. Version: " + SdkInfo.GetVersion();
            var logger = SdkLoggerFactory.GetLoggerForExecution(typeof(Feed));

            logger.Info($"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForCache(typeof(Feed));
            logger.Info($"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForClientInteraction(typeof(Feed));
            logger.Info($"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForRestTraffic(typeof(Feed));
            logger.Info($"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForFeedTraffic(typeof(Feed));
            logger.Info($"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForStats(typeof(Feed));
            logger.Info($"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
        }
Beispiel #2
0
        private static void LogInit()
        {
            var msg    = "MtsSdk initialization. Version: " + SdkInfo.GetVersion();
            var logger = SdkLoggerFactory.GetLoggerForFeedTraffic(typeof(MtsSdk));

            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForCache(typeof(MtsSdk));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForClientInteraction(typeof(MtsSdk));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForRestTraffic(typeof(MtsSdk));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForStats(typeof(MtsSdk));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForExecution(typeof(MtsSdk));
            logger.LogInformation(msg);
        }
Beispiel #3
0
        private void LogInit()
        {
            var msg    = "UF SDK .NET initialization. Version: " + SdkInfo.GetVersion();
            var logger = SdkLoggerFactory.GetLoggerForFeedTraffic(typeof(Feed));

            Contract.Assume(logger != null);
            logger.Info(msg);
            logger = SdkLoggerFactory.GetLoggerForCache(typeof(Feed));
            logger.Info(msg);
            logger = SdkLoggerFactory.GetLoggerForClientInteraction(typeof(Feed));
            logger.Info(msg);
            logger = SdkLoggerFactory.GetLoggerForRestTraffic(typeof(Feed));
            logger.Info(msg);
            logger = SdkLoggerFactory.GetLoggerForExecution(typeof(Feed));
            logger.Info(msg);
            logger = SdkLoggerFactory.GetLoggerForStats(typeof(Feed));
            logger.Info(msg);
        }
Beispiel #4
0
        private void LogInit()
        {
            var msg    = "UF SDK .NET Core initialization. Version: " + SdkInfo.GetVersion();
            var logger = SdkLoggerFactory.GetLoggerForExecution(typeof(Feed));

            if (logger == null)
            {
                return;
            }
            logger.Log(SdkLoggerFactory.GetWriteLogLevel(logger, LogLevel.Information), $"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForCache(typeof(Feed));
            logger.Log(SdkLoggerFactory.GetWriteLogLevel(logger, LogLevel.Information), $"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForClientInteraction(typeof(Feed));
            logger.Log(SdkLoggerFactory.GetWriteLogLevel(logger, LogLevel.Information), $"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForRestTraffic(typeof(Feed));
            logger.Log(SdkLoggerFactory.GetWriteLogLevel(logger, LogLevel.Information), $"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForFeedTraffic(typeof(Feed));
            logger.Log(SdkLoggerFactory.GetWriteLogLevel(logger, LogLevel.Information), $"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
            logger = SdkLoggerFactory.GetLoggerForStats(typeof(Feed));
            logger.Log(SdkLoggerFactory.GetWriteLogLevel(logger, LogLevel.Information), $"{msg}. LogLevel: {SdkLoggerFactory.GetLoggerLogLevel(logger)}");
        }
        private void LogInit()
        {
            var msg    = "UF SDK .NET initialization. Version: " + SdkInfo.GetVersion();
            var logger = SdkLoggerFactory.GetLoggerForFeedTraffic(typeof(Feed));

            if (logger == null)
            {
                return;
            }
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForCache(typeof(Feed));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForClientInteraction(typeof(Feed));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForRestTraffic(typeof(Feed));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForExecution(typeof(Feed));
            logger.LogInformation(msg);
            logger = SdkLoggerFactory.GetLoggerForStats(typeof(Feed));
            logger.LogInformation(msg);
        }
Beispiel #6
0
        private static void PrintLogManagerStatus()
        {
            Console.WriteLine($"Number of loggers: {LogManager.GetCurrentLoggers().Length}");
            foreach (var l in LogManager.GetCurrentLoggers())
            {
                Console.WriteLine($"\tLogger: {l.Logger.Name}");
                foreach (var a in l.Logger.Repository.GetAppenders())
                {
                    Console.WriteLine($"\t\t Appender: {a.Name}");
                }
            }
            Console.WriteLine($"Number of repositories: {LogManager.GetAllRepositories().Length}");
            foreach (var l in LogManager.GetAllRepositories())
            {
                Console.WriteLine($"\tRepository: {l.Name}");
            }

            Console.WriteLine(Environment.NewLine);

            var logDefault         = SdkLoggerFactory.GetLogger(typeof(SdkLogTest), SdkCommon.TestData.SdkTestLogRepositoryName);
            var logCache           = SdkLoggerFactory.GetLoggerForCache(typeof(SdkLogTest), SdkCommon.TestData.SdkTestLogRepositoryName);
            var logClientIteration = SdkLoggerFactory.GetLoggerForClientInteraction(typeof(SdkLogTest), SdkCommon.TestData.SdkTestLogRepositoryName);
            var logFeedTraffic     = SdkLoggerFactory.GetLoggerForFeedTraffic(typeof(SdkLogTest), SdkCommon.TestData.SdkTestLogRepositoryName);
            var logRestTraffic     = SdkLoggerFactory.GetLoggerForRestTraffic(typeof(SdkLogTest), SdkCommon.TestData.SdkTestLogRepositoryName);
            var logStatsTraffic    = SdkLoggerFactory.GetLoggerForStats(typeof(SdkLogTest), SdkCommon.TestData.SdkTestLogRepositoryName);

            LogPrint(logDefault);
            LogPrint(logCache);
            LogPrint(logClientIteration);
            LogPrint(logFeedTraffic);
            LogPrint(logRestTraffic);
            LogPrint(logStatsTraffic);

            //for (int i = 0; i < 10000; i++)
            //{
            //    LogPrint(logRestTraffic);
            //}
        }