{
namespace Microsoft.Extensions.Logging {
public static class EventLoggerFactoryExtensions {
- public static ILoggerFactory AddEventLog(this ILoggerFactory factory);
- public static ILoggerFactory AddEventLog(this ILoggerFactory factory, EventLogSettings settings);
- public static ILoggerFactory AddEventLog(this ILoggerFactory factory, LogLevel minLevel);
+ public static ILoggingBuilder AddEventLog(this ILoggingBuilder builder, Action<EventLogSettings> configure);
}
}
namespace Microsoft.Extensions.Logging.EventLog {
- public class EventLogLogger : ILogger {
{
- public EventLogLogger(string name);
- public EventLogLogger(string name, EventLogSettings settings);
- public EventLogLogger(string name, EventLogSettings settings, IExternalScopeProvider externalScopeProvider);
- public IEventLog EventLog { get; }
- public IDisposable BeginScope<TState>(TState state);
- public bool IsEnabled(LogLevel logLevel);
- public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter);
- }
public class EventLogLoggerProvider : IDisposable, ILoggerProvider, ISupportExternalScope {
+ public EventLogLoggerProvider(IOptions<EventLogSettings> options);
}
public class EventLogSettings {
- public IEventLog EventLog { get; set; }
}
- public class WindowsEventLog : IEventLog {
{
- public WindowsEventLog(string logName, string machineName, string sourceName);
- public EventLog DiagnosticsEventLog { get; }
- public int MaxMessageSize { get; }
- public void WriteEntry(string message, EventLogEntryType type, int eventID, short category);
- }
}
- namespace Microsoft.Extensions.Logging.EventLog.Internal {
{
- public interface IEventLog {
{
- int MaxMessageSize { get; }
- void WriteEntry(string message, EventLogEntryType type, int eventID, short category);
- }
- }
}