EDIT 4: \"From\" seems to be a reserved word in NLog. Changing it \"FromID\" worked. this is an awesome way to pass variables to NLog and still keep your code clean !!!! TH
This is propably not the best way to do this and not even thread safe but a quick and dirty solution: You could use Environment variables:
Environment.SetEnvironmentVariable("NLogOptionID", "87");
logger.Debug("My Name id Ed");
Environment.SetEnvironmentVariable("NLogOptionID", null);
In your layout, you can use environment variables.
${environment:variable=NLogOptionID}