Not at computer now so can't try your case, but I have a couple of questions.
Can you try using the "regular" logging functions (Info, Debug) and see if that works ad expected?
How did you resolve your logger? That is. What is "logger's" name?
If the actual logger's name is not "Model" my guess is that it won't meet the "Model" condition, even though you are passing "Model" in the Name field of the LogEventInfo.
[EDIT]
Here is an abbreviated example of a better NLog logger wrapper that could be used in the Ninject Logging Extension. This wrapper delegates logging calls to the underlying NLog logger in a way that preserves the call site information (class and method where logging request originated).
class NLogLogger : ILogger
{
private NLog.Logger logger;
//The Type that is passed in is ultimately the type of the current object that
//Ninject is creating. In the case of my example, it is Class1 and Class1 is
//dependent on ILogger.
public NLogLogger(Type t)
{
logger = NLog.LogManager.GetLogger(t.FullName);
}
//Trace, Warn, Error, Fatal eliminated for brevity
public bool IsInfoEnabled
{
get { return logger.IsInfoEnabled; }
}
public bool IsDebugEnabled
{
get { return logger.IsDebugEnabled; }
}
public void Info(string format, params object [] args)
{
if (logger.IsInfoEnabled)
{
Write(LogLevel.Info, format, args);
}
}
public void Debug(string format, params object [] args)
{
if (logger.IsDebugEnabled)
{
Write(LogLevel.Debug, format, args);
}
}
private void Write(LogLevel level, string format, params object [] args)
{
LogEventInfo le = new LogEventInfo(level, logger.Name, null, format, args);
logger.Log(typeof(NLogLogger), le);
}
}
Obviously this example does not deal with exceptions. However, I think that it illustrates the correct way to wrap NLog. It would be easy enough to implement the full Ninject Logging Extension ILogger interface, delegating each Info, Debug, Warn, etc call to a central Write method that would create the LogEventInfo class and then log it using the underlying NLog logger instance, passing in the type of the wrapping logger (typeof(NLogLogger)
in my example). Passing the type of the wrapping logger is critical for maintaining call site info for your logging calls from your application code.
Based on NLog wrapper found in the Ninject Logging Extensions git repository.
More about dependency injection and named loggers (like NLog and log4net).
See my answer here for more about problems with naive logger wrappers.