You just need a class to act as a TextWriter that LINQ to SQL needs to dispatch it via the method you want, e.g.
db.Log = new ActionTextWriter(s => logger.Debug(s));
Here is a little text writer I wrote that takes a delegate and dispatches to that so you use the code above. You would probably want to change this class so it took a logger, did some processing/splitting on the text and then dispatched it out to NLog.
class ActionTextWriter : TextWriter {
private Action<string> action;
public ActionTextWriter(Action<string> action) {
this.action = action;
}
public override void Write(char[] buffer, int index, int count) {
Write(new string(buffer, index, count));
}
public override void Write(string value) {
action.Invoke(value);
}
public override Encoding Encoding {
get { return System.Text.Encoding.Default; }
}
}