I am logging from an ASP.NET app using NLog. Everything works great except for the ${logger}. My log files are missing the logger name. Here is the target line from NLog configuration file:
<target name="DebugToFile" xsi:type="File" fileName="${basedir}/Debug.log" layout="${logger} | ${longdate} | ${message}" />
Here is what I get in the log file:
| 2013-10-05 17:55:20.9852 | In Decrypt
| 2013-10-05 17:55:20.9852 | In Deserialize
And here is the C# line that creates an instance of the logger:
new Log("Iamalogger").Debug("In Decrypt");
Any ideas why ${logger} isn't getting picked up?
Edit: 1/14/2014 Here is the log wrapper I am using:
public class Log
{
private Logger _log;
public Log(string class)
{
_log = LogManager.GetLogger(class);
}
//methods for logging...
}