Esempio n. 1
0
        private void ApppendLogsTo(string logFileName, LogEventArg e)
        {
            if (logFileName.IsBlank())
            {
                return;
            }
            switch (e.Level)
            {
            case L4j.Off:                   //
            case L4j.Debug:                 //  ignore these levels
            case L4j.Trace: return;         //
            }
            if (e.ShowAs != ShowLogAs.Normal)
            {
                return;
            }

            if (_logFile == null)
            {
                _logFile = _fs.File(_fs.GetAssemblyDir().Bslash(logFileName));
            }

            var line = L.f + TextLog.Format(e.Title, e.Message);

            _logFile.Write(line, EncodeAs.UTF8, false, false);
        }