Ejemplo n.º 1
0
        public void Initialize(PokerClientLoggerConfiguration configuration)
        {
            if (configuration == null)
            {
                return;
            }

            this.configuration = configuration;

            try
            {
                // Create log directory
                if (!Directory.Exists(configuration.LogDirectory))
                {
                    Directory.CreateDirectory(configuration.LogDirectory);
                }

                // Generate AES key and IV
                using (var aesCryptoProvider = new AesManaged())
                {
                    aesCryptoProvider.GenerateKey();
                    aesCryptoProvider.GenerateIV();

                    aesKey = aesCryptoProvider.Key;
                    aesIV  = aesCryptoProvider.IV;
                }

                isInitialized = true;
            }
            catch
            {
                LogProvider.Log.Error("Logger service has not been initialized.");
            }
        }
Ejemplo n.º 2
0
        protected override PokerClientLoggerConfiguration CreatePokerClientLoggerConfiguration()
        {
            var logger = new PokerClientLoggerConfiguration
            {
                DateFormat         = "yyy-MM-dd",
                DateTimeFormat     = "HH:mm:ss",
                LogCleanupTemplate = "pbz-games-*-*-*.log",
                LogDirectory       = "Logs",
                LogTemplate        = "pbz-games-{0}.log",
                MessagesInBuffer   = 30
            };

            return(logger);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes logger with protection
        /// </summary>
        protected virtual void InitializeLogger()
        {
            var logger = new PokerClientLoggerConfiguration
            {
                DateFormat         = "yyy-MM-dd",
                DateTimeFormat     = "HH:mm:ss",
                LogCleanupTemplate = "adda-games-*-*-*.log",
                LogDirectory       = "Logs",
                LogTemplate        = "adda-games-{0}.log",
                MessagesInBuffer   = 10
            };

            protectedLogger = ServiceLocator.Current.GetInstance <IPokerClientEncryptedLogger>(LogServices.Base.ToString());
            protectedLogger.Initialize(logger);
            protectedLogger.CleanLogs();
            protectedLogger.StartLogging();
        }
Ejemplo n.º 4
0
 public void Initialize(PokerClientLoggerConfiguration configuration)
 {
 }