#region Apache License
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to you under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
using System;
using System.Collections;
using log4net;
using log4net.ObjectRenderer;
using log4net.Core;
using log4net.Plugin;
using log4net.Repository.Hierarchy;
using log4net.Util;
namespace log4net.Repository
{
#region LoggerRepositoryShutdownEvent
///
/// Delegate used to handle logger repository shutdown event notifications
///
/// The that is shutting down.
/// Empty event args
///
///
/// Delegate used to handle logger repository shutdown event notifications.
///
///
public delegate void LoggerRepositoryShutdownEventHandler(object sender, EventArgs e);
#endregion
#region LoggerRepositoryConfigurationResetEventHandler
///
/// Delegate used to handle logger repository configuration reset event notifications
///
/// The that has had its configuration reset.
/// Empty event args
///
///
/// Delegate used to handle logger repository configuration reset event notifications.
///
///
public delegate void LoggerRepositoryConfigurationResetEventHandler(object sender, EventArgs e);
#endregion
#region LoggerRepositoryConfigurationChangedEventHandler
///
/// Delegate used to handle event notifications for logger repository configuration changes.
///
/// The that has had its configuration changed.
/// Empty event arguments.
///
///
/// Delegate used to handle event notifications for logger repository configuration changes.
///
///
public delegate void LoggerRepositoryConfigurationChangedEventHandler(object sender, EventArgs e);
#endregion
///
/// Interface implemented by logger repositories.
///
///
///
/// This interface is implemented by logger repositories. e.g.
/// .
///
///
/// This interface is used by the
/// to obtain interfaces.
///
///
/// Nicko Cadell
/// Gert Driesen
public interface ILoggerRepository
{
///
/// The name of the repository
///
///
/// The name of the repository
///
///
///
/// The name of the repository.
///
///
string Name { get; set; }
///
/// RendererMap accesses the object renderer map for this repository.
///
///
/// RendererMap accesses the object renderer map for this repository.
///
///
///
/// RendererMap accesses the object renderer map for this repository.
///
///
/// The RendererMap holds a mapping between types and
/// objects.
///
///
RendererMap RendererMap { get; }
///
/// The plugin map for this repository.
///
///
/// The plugin map for this repository.
///
///
///
/// The plugin map holds the instances
/// that have been attached to this repository.
///
///
PluginMap PluginMap { get; }
///
/// Get the level map for the Repository.
///
///
///
/// Get the level map for the Repository.
///
///
/// The level map defines the mappings between
/// level names and objects in
/// this repository.
///
///
LevelMap LevelMap { get; }
///
/// The threshold for all events in this repository
///
///
/// The threshold for all events in this repository
///
///
///
/// The threshold for all events in this repository.
///
///
Level Threshold { get; set; }
///
/// Check if the named logger exists in the repository. If so return
/// its reference, otherwise returns null.
///
/// The name of the logger to lookup
/// The Logger object with the name specified
///
///
/// If the names logger exists it is returned, otherwise
/// null is returned.
///
///
ILogger Exists(string name);
///
/// Returns all the currently defined loggers as an Array.
///
/// All the defined loggers
///
///
/// Returns all the currently defined loggers as an Array.
///
///
ILogger[] GetCurrentLoggers();
///
/// Returns a named logger instance
///
/// The name of the logger to retrieve
/// The logger object with the name specified
///
///
/// Returns a named logger instance.
///
///
/// If a logger of that name already exists, then it will be
/// returned. Otherwise, a new logger will be instantiated and
/// then linked with its existing ancestors as well as children.
///
///
ILogger GetLogger(string name);
/// Shutdown the repository
///
///
/// Shutting down a repository will safely close and remove
/// all appenders in all loggers including the root logger.
///
///
/// Some appenders need to be closed before the
/// application exists. Otherwise, pending logging events might be
/// lost.
///
///
/// The method is careful to close nested
/// appenders before closing regular appenders. This is allows
/// configurations where a regular appender is attached to a logger
/// and again to a nested appender.
///
///
void Shutdown();
///
/// Reset the repositories configuration to a default state
///
///
///
/// Reset all values contained in this instance to their
/// default state.
///
///
/// Existing loggers are not removed. They are just reset.
///
///
/// This method should be used sparingly and with care as it will
/// block all logging until it is completed.
///
///
void ResetConfiguration();
///
/// Log the through this repository.
///
/// the event to log
///
///
/// This method should not normally be used to log.
/// The interface should be used
/// for routine logging. This interface can be obtained
/// using the method.
///
///
/// The logEvent is delivered to the appropriate logger and
/// that logger is then responsible for logging the event.
///
///
void Log(LoggingEvent logEvent);
///
/// Flag indicates if this repository has been configured.
///
///
/// Flag indicates if this repository has been configured.
///
///
///
/// Flag indicates if this repository has been configured.
///
///
bool Configured { get; set; }
///
/// Collection of internal messages captured during the most
/// recent configuration process.
///
ICollection ConfigurationMessages { get; set; }
///
/// Event to notify that the repository has been shutdown.
///
///
/// Event to notify that the repository has been shutdown.
///
///
///
/// Event raised when the repository has been shutdown.
///
///
event LoggerRepositoryShutdownEventHandler ShutdownEvent;
///
/// Event to notify that the repository has had its configuration reset.
///
///
/// Event to notify that the repository has had its configuration reset.
///
///
///
/// Event raised when the repository's configuration has been
/// reset to default.
///
///
event LoggerRepositoryConfigurationResetEventHandler ConfigurationReset;
///
/// Event to notify that the repository has had its configuration changed.
///
///
/// Event to notify that the repository has had its configuration changed.
///
///
///
/// Event raised when the repository's configuration has been changed.
///
///
event LoggerRepositoryConfigurationChangedEventHandler ConfigurationChanged;
///
/// Repository specific properties
///
///
/// Repository specific properties
///
///
///
/// These properties can be specified on a repository specific basis.
///
///
PropertiesDictionary Properties { get; }
///
/// Returns all the Appenders that are configured as an Array.
///
/// All the Appenders
///
///
/// Returns all the Appenders that are configured as an Array.
///
///
log4net.Appender.IAppender[] GetAppenders();
}
}