Beispiel #1
0
        private void LogEx(LogLevel level, Exception exception, string message, params object[] parameters)
        {
            StringBuilder sb = NcfLogEngineProvider.AcquireStringBuilder();

            this.WriteDateTime(sb);
            sb.Append(" ");
            this.WriteLevel(sb, level);
            sb.Append(" ");
            this.WriteMessage(sb, message, parameters);

            if (exception != null)
            {
                sb.AppendLine();
                this.WriteException(sb, exception);
            }

            sb.AppendLine();

            byte[] buffer = Encoding.UTF8.GetBytes(sb.ToString());

            this._writer.Write(buffer);
        }
Beispiel #2
0
 static Logger()
 {
     _le = new NcfLogEngineProvider();
     _le.Initialize();
 }