Пример #1
0
        private string FormatFile(string user, string message, Common.LogLevel logLevel)
        {
            buildFormat = new StringBuilder();

            buildFormat.AppendFormat("Date : {0} \n", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")).AppendLine();
            buildFormat.AppendFormat("Logtype : {0} \n", logLevel.ToString()).AppendLine();
            buildFormat.AppendFormat("User : {0} \n", user).AppendLine();
            buildFormat.AppendFormat("Message : \n {0} \n", message).AppendLine();
            buildFormat.AppendLine("-------------------------");

            return(buildFormat.ToString());
        }
Пример #2
0
        private string FormatFile(object logContext, string user, string message, Exception ex, Common.LogLevel logLevel)
        {
            buildFormat = new StringBuilder();

            buildFormat.AppendFormat("Date : {0} \n", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")).AppendLine();
            buildFormat.AppendFormat("Logtype : {0} \n", logLevel.ToString()).AppendLine();
            buildFormat.AppendFormat("User : {0} ", user).AppendLine();
            buildFormat.AppendFormat("Message : {0}", message).AppendLine();
            buildFormat.AppendFormat("ValueObject : \n {0} \n", Common.Helpers.BuildStringLog(logContext)).AppendLine();

            if (ex != null)
            {
                buildFormat.AppendFormat("Exception : \n {0} \n ", ex.ToString());
            }

            buildFormat.AppendLine("--------------------------");

            return(buildFormat.ToString());
        }