Q: Log File Depending on Property Selected in Class Attribute I want to create a per file logger which will log to files depending on type and the specifications of an attribute on that type, but I'm having difficulty doing it in a trivial manner.
So I would enumerate through all types using a LogOutputAttribute
[System.AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class LogOutputAttribute : Attribute
{
    public string[] Directories { get; set; }

    public LogOutputAttribute(params string[] directories)
    {
        Directories = directories;
    }

    public string ResolveOnMember { get; set; }
}

Which is used as such:
[LogOutput("Logging", "Subjects", ResolveOnMember = nameof(Name))]
public class LogSubject
{
    public string Name { get; set; }
}

And in my logger creation:
var dirs = new string[] { Path.GetDirectoryName("Logging") };
var logFileName = "Main";

var config = new LoggerConfiguration();

foreach (var type in types)
{
    if (type.GetCustomAttributes(typeof(LogOutputAttribute), true).SingleOrDefault() is LogOutputAttribute logOutput)
    {
        dirs = logOutput.Directories;
        logFileName = logOutput.ResolveOnMember;
    }

    var path = Path.Combine(dirs);
    Directory.CreateDirectory(path);
    Console.WriteLine("Writing to " + path);

    config = config.WriteTo.Logger(lc => lc
        .Filter.ByIncludingOnly(Matching.FromSource(type.FullName))
        .WriteTo.Map(logFileName, "unknown", (n, wt) =>
        {
            path = Path.Combine(path, n + ".txt");
            wt.File(path, rollingInterval: RollingInterval.Day);
        }));
}

var logger = config.CreateLogger();

I'd like to enrich the message with the property name and value chosen by the attribute ResolveOnMember when the log comes through so it would be processed by the mapping in .Map, not sure how or if it's possible to do this.
Another way would be using ForContext using contextual DI injection,
I use Dryioc which would look like 
container.Register<Logging.ILogger>(
    made: Made.Of(() => LoggerFactory.GetLogger(new LogContext("SourceContext", Arg.Index<Type>(0))), r => r.Parent.ImplementationType),
    setup: Setup.With(condition: r => r.Parent.ImplementationType != null));

But I can't see how to insert the value the chosen ResolveOnMember from here.
