예제 #1
0
        private static void Write(CommonLib.Log.LogType type, string file, int line, string member, string message)
        {
            var msg = new List <object>();

            msg.Add("Member");
            msg.Add(member);
            msg.Add("Message");
            msg.Add(message);

            //if (OperationContext.Current != null &&
            //    OperationContext.Current.IncomingMessageProperties != null &&
            //    OperationContext.Current.IncomingMessageProperties.ContainsKey(RemoteEndpointMessageProperty.Name))
            //{
            //    var property = (RemoteEndpointMessageProperty)OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name];

            //    msg.Add("Computer");
            //    msg.Add(property.Address);
            //}

            if (System.Web.HttpContext.Current != null && System.Web.HttpContext.Current.Request != null)
            {
                msg.Add("Computer");
                msg.Add(System.Web.HttpContext.Current.Request.UserHostAddress);
            }

            var sender = System.IO.Path.GetFileName(file) + ":" + line.ToString();

            CommonLib.Log.CustomLog.Write(sender, type, msg.ToArray());
        }
예제 #2
0
        private static void Write(CommonLib.Log.LogType type, string file, int line, string member, string message)
        {
            var msg = new List <object>();

            msg.Add("Member");
            msg.Add(member);
            msg.Add("Message");
            msg.Add(message);

            var sender = System.IO.Path.GetFileName(file) + ":" + line.ToString();

            CommonLib.Log.CustomLog.Write(sender, type, msg.ToArray());
        }
예제 #3
0
        private static void LogFormat(CommonLib.Log.LogType type, string file, int line, string member, string format, params object[] args)
        {
            string msg = string.Format(format, args);

            Write(type, file, line, member, msg);
        }
예제 #4
0
        private static void Log(CommonLib.Log.LogType type, string file, int line, string member, object message)
        {
            string msg = (message != null) ? message.ToString() : "";

            Write(type, file, line, member, msg);
        }