update 20250721
This commit is contained in:
@@ -20,11 +20,22 @@ namespace API_NetFramework.Models
|
||||
if (Logging.Logging.IntLogLevel == "")
|
||||
{
|
||||
string connectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["EDOKAConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
string journalconnectionstring = StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["JournalConnectionstring"].ConnectionString, "i%!k!7pab%bNLdA5hE4pkR4XaB%E^jB3d9tHuQ4pbF&BZjF7SB#WBWit5#HrbJiLrLVm");
|
||||
DB db = new DB(connectionstring);
|
||||
db.Get_Tabledata("Select * from nlog_parameter where id=3", false, true);
|
||||
Logging.Logging.IntLogLevel = db.dsdaten.Tables[0].Rows[0]["LogLevel"].ToString();
|
||||
Logging.Logging.IntUserID = db.dsdaten.Tables[0].Rows[0]["LogUserID"].ToString();
|
||||
//Logging.Logging.connectionstring = journalconnectionstring;
|
||||
//Logging.Logging.init_logger();
|
||||
db.Get_Tabledata("Select * from nlog_parameter WHERE ID=2", false, true);
|
||||
Logging.DocLog.IntLogLevel = db.dsdaten.Tables[0].Rows[0]["LogLevel"].ToString();
|
||||
Logging.DocLog.IntUserID = db.dsdaten.Tables[0].Rows[0]["LogUserID"].ToString();
|
||||
Logging.DocLog.connectionstring= journalconnectionstring;
|
||||
Logging.DocLog.init_logger();
|
||||
// Logging.DocLog.init_logger();
|
||||
//Logging.DocLog.connectionstring = connectionstring;
|
||||
db = null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,5 +69,35 @@ namespace API_NetFramework.Models
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public static void DocLog(HttpRequestMessage request, string partnernr, string message, string dokumentid, LogLevelType logtype)
|
||||
{
|
||||
string userhost = "";
|
||||
if (request.Properties.ContainsKey("MS_HttpContext"))
|
||||
{
|
||||
userhost = ((HttpContextWrapper)request.Properties["MS_HttpContext"]).Request.UserHostAddress;
|
||||
}
|
||||
switch (logtype)
|
||||
{
|
||||
case LogLevelType.Info:
|
||||
Logging.DocLog.Info(message, request.RequestUri.ToString(), dokumentid, partnernr, "");
|
||||
break;
|
||||
case LogLevelType.Warning:
|
||||
Logging.DocLog.Warning(message, request.RequestUri.ToString(), dokumentid, partnernr, "");
|
||||
break;
|
||||
case LogLevelType.Trace:
|
||||
Logging.DocLog.Trance(message, request.RequestUri.ToString(), dokumentid, partnernr, "");
|
||||
break;
|
||||
case LogLevelType.Debug:
|
||||
Logging.DocLog.Debug(message, request.RequestUri.ToString(), dokumentid, partnernr, "");
|
||||
break;
|
||||
case LogLevelType.Error:
|
||||
Logging.DocLog.Error(message, request.RequestUri.ToString(), dokumentid, partnernr, "");
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user