Skip to content

Commit 9c9dbd6

Browse files
author
Mathias Tausig
committed
Used the log4net.ILog.Logger.Log method for issuing log calls, to get
a correct class description in the log messages
1 parent a29d434 commit 9c9dbd6

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/ServiceStack.Logging.Log4Netv1210/Log4NetLogger.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Log4NetLogger(Type type)
3232
public void Debug(object message)
3333
{
3434
if (_log.IsDebugEnabled)
35-
_log.Debug(message);
35+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Debug, message, null);
3636
}
3737

3838
/// <summary>
@@ -43,8 +43,8 @@ public void Debug(object message)
4343
public void Debug(object message, Exception exception)
4444
{
4545
if (_log.IsDebugEnabled)
46-
_log.Debug(message, exception);
47-
}
46+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Debug, message, exception);
47+
}
4848

4949
/// <summary>
5050
/// Logs a Debug format message.
@@ -54,7 +54,7 @@ public void Debug(object message, Exception exception)
5454
public void DebugFormat(string format, params object[] args)
5555
{
5656
if (_log.IsDebugEnabled)
57-
_log.DebugFormat(format, args);
57+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Debug, String.Format (format, args), null);
5858
}
5959

6060
/// <summary>
@@ -64,7 +64,7 @@ public void DebugFormat(string format, params object[] args)
6464
public void Error(object message)
6565
{
6666
if (_log.IsErrorEnabled)
67-
_log.Error(message);
67+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Error, message, null);
6868
}
6969

7070
/// <summary>
@@ -75,7 +75,7 @@ public void Error(object message)
7575
public void Error(object message, Exception exception)
7676
{
7777
if (_log.IsErrorEnabled)
78-
_log.Error(message, exception);
78+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Error, message, exception);
7979
}
8080

8181
/// <summary>
@@ -86,7 +86,7 @@ public void Error(object message, Exception exception)
8686
public void ErrorFormat(string format, params object[] args)
8787
{
8888
if (_log.IsErrorEnabled)
89-
_log.ErrorFormat(format, args);
89+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Error, String.Format (format, args), null);
9090
}
9191

9292
/// <summary>
@@ -96,7 +96,7 @@ public void ErrorFormat(string format, params object[] args)
9696
public void Fatal(object message)
9797
{
9898
if (_log.IsFatalEnabled)
99-
_log.Fatal(message);
99+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Fatal, message, null);
100100
}
101101

102102
/// <summary>
@@ -107,7 +107,7 @@ public void Fatal(object message)
107107
public void Fatal(object message, Exception exception)
108108
{
109109
if (_log.IsFatalEnabled)
110-
_log.Fatal(message, exception);
110+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Fatal, message, exception);
111111
}
112112

113113
/// <summary>
@@ -118,7 +118,7 @@ public void Fatal(object message, Exception exception)
118118
public void FatalFormat(string format, params object[] args)
119119
{
120120
if (_log.IsFatalEnabled)
121-
_log.FatalFormat(format, args);
121+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Fatal, String.Format(format, args), null);
122122
}
123123

124124
/// <summary>
@@ -128,7 +128,7 @@ public void FatalFormat(string format, params object[] args)
128128
public void Info(object message)
129129
{
130130
if (_log.IsInfoEnabled)
131-
_log.Info(message);
131+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Info, message, null);
132132
}
133133

134134
/// <summary>
@@ -139,7 +139,7 @@ public void Info(object message)
139139
public void Info(object message, Exception exception)
140140
{
141141
if (_log.IsInfoEnabled)
142-
_log.Info(message, exception);
142+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Info, message, exception);
143143
}
144144

145145
/// <summary>
@@ -150,7 +150,7 @@ public void Info(object message, Exception exception)
150150
public void InfoFormat(string format, params object[] args)
151151
{
152152
if (_log.IsInfoEnabled)
153-
_log.InfoFormat(format, args);
153+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Info, String.Format (format, args), null);
154154
}
155155

156156
/// <summary>
@@ -160,7 +160,7 @@ public void InfoFormat(string format, params object[] args)
160160
public void Warn(object message)
161161
{
162162
if (_log.IsWarnEnabled)
163-
_log.Warn(message);
163+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Warn, message, null);
164164
}
165165

166166
/// <summary>
@@ -171,7 +171,7 @@ public void Warn(object message)
171171
public void Warn(object message, Exception exception)
172172
{
173173
if (_log.IsWarnEnabled)
174-
_log.Warn(message, exception);
174+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Warn, message, exception);
175175
}
176176

177177
/// <summary>
@@ -182,7 +182,7 @@ public void Warn(object message, Exception exception)
182182
public void WarnFormat(string format, params object[] args)
183183
{
184184
if (_log.IsWarnEnabled)
185-
_log.WarnFormat(format, args);
185+
_log.Logger.Log(typeof(Log4NetLogger), log4net.Core.Level.Warn, String.Format(format, args), null);
186186
}
187187
}
188188
}

0 commit comments

Comments
 (0)