Log4net
This commit is contained in:
@@ -30,10 +30,12 @@ namespace BeWo.Service.ServiceBehavior.JsonError
|
||||
|
||||
public class JsonErrorHandler : IErrorHandler
|
||||
{
|
||||
private static readonly log4net.ILog log = ServiceLogger.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
|
||||
{
|
||||
// Logge in File
|
||||
ServiceLogger.JsonErrorLogger.LogError(error);
|
||||
log.Error(error);
|
||||
|
||||
// Erstelle eine JSON-Fehlermeldung
|
||||
var jsonError = new JsonError
|
||||
@@ -44,7 +46,7 @@ namespace BeWo.Service.ServiceBehavior.JsonError
|
||||
|
||||
// Fügt StackTrace hinzu (AppSettings)
|
||||
string val = ConfigurationManager.AppSettings["AdminServiceEnableStackTrace"];
|
||||
if(bool.TryParse(val, out bool res) && res)
|
||||
if (bool.TryParse(val, out bool res) && res)
|
||||
{
|
||||
jsonError.StackTrace = error.StackTrace;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user