Passing LogEventInfo in Log methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Passing LogEventInfo in Log methods

The event context layout renderer gets its parameters from the LogEventInfo parameter, for example:

However the LogEventInfo parameter is only available in only 2 of the Log method signatures:
        public void Log(Type wrapperType, LogEventInfo logEvent)
        public void Log(LogEventInfo logEvent)

How can I pass the LogEventInfo if I want to use other Log methods, for example:
        public void Log<T>(LogLevel level, IFormatProvider formatProvider, T value)
        public void Log(LogLevel level, LogMessageGenerator messageFunc)
        public void LogException(LogLevel level, [Localizable(false)] string message, Exception exception)

Assuming this is not possible in NLog 2.0, what workarounds are available?