Hey guys
I have sent a little bit of time putting down on paper the changes/
additions that this unit of work will include.
Let me know what you think and I hope it pretty much makes sense
Cheers
Anthony
//Change to ILogger interface
// -- Castle.Core.Logging
public interface ILogger
{
....
void Log(ILoggingEvent loggingEvent);
ILoggingEvent CreateLoggingEvent(); //If anyone know a
better place to get the instance from please let me know
....
}
//New ILoggingEvent interface
// -- Castle.Core.Logging
public interface ILoggingEvent
{
Type DeclaringType { get; }
LoggerLevel LoggerLevel { get; }
String LoggerName { get; }
String Message { get; }
Exception Exception { get; }
}
//New IExtendedLoggingEvent interface
// -- Castle.Core.Logging
public interface IExtendedLoggingEvent : ILoggingEvent
{
IKeyContextProperties Properties { get; }
}
//New IKeyContextProperties interface
// -- Castle.Core.Logging
public interface IKeyContextProperties : IContextProperties,
IDictionary
{
}
//New NullLoggingEvent class
// -- Castle.Core.Logging
public class LoggingEvent : ILoggingEvent
{
....
}
//New NullLoggingEvent class
// -- Castle.Core.Logging
public class NullLoggingEvent : IExtendedLoggingEvent
{
....
}
//New NullKeyContextProperties Class
// -- Castle.Core.Logging
public class NullKeyContextProperties : IKeyContextProperties
{
....
}
//New LoggingEvent Class
// -- Castle.Services.Logging.Log4netIntegration
public class LoggingEvent : Castle.Core.Logging.LoggingEvent
{
private log4Net.Core.LoggingEvent _InnerLoggingEvent;
....
public LoggingEvent(Type declaringType, LoggerLevel
loggerLevel, String loggerName, String message, Exception exception)
{
_InnerLoggingEvent = new log4Net.Core.LoggingEvent
(declaringType, loggerLevel, loggerName, message, exception);
}
....
public log4Net.Core.LoggingEvent InnerLoggingEvent
{
get { return _InnerLoggingEvent; }
}
....
}
//New ExtendedLoggingEvent Class
// -- Castle.Services.Logging.Log4netIntegration
public class ExtendedLoggingEvent :
Castle.Services.Logging.Log4netIntegration.LoggingEvent,
IExtendedLoggingEvent
{
private IKeyContextProperties _Properties;
....
public ExtendedLoggingEvent(Type declaringType, LoggerLevel
loggerLevel, String loggerName, String message, Exception exception)
: base(declaringType, loggerLevel, loggerName, message,
exception)
{
}
....
public IKeyContextProperties Properties
{
if (_Properties == null)
_Properties = new LocalContextProperties
(this.InnerLoggingEvent.Properties);
return _Properties;
}
....
}
//New LocalContextProperties Class
// -- Castle.Services.Logging.Log4netIntegration
public class LocalContextProperties : IKeyContextProperties
{
private log4net.Util.PropertiesDictionary _InnerProperties;
....
public LocalContextProperties
(log4net.Util.PropertiesDictionary innerProperties)
{
_InnerProperties = innerProperties;
}
....
public object this[string key]
{
get { return _InnerProperties.Properties[key]; }
set { _InnerProperties.Properties[key] = value; }
}
....
}
//Changes to Log4netLogger Class
// -- Castle.Services.Logging.Log4netIntegration
public class Log4netLogger
{
....
public override ILoggingEvent CreateLoggingEvent()
{
return new LoggingEvent();
}
....
void override Log(ILoggingEvent loggingEvent)
{
Castle.Services.Logging.Log4netIntegration.LoggingEvent
innerLoggingEvent = loggingEvent as
Castle.Services.Logging.Log4netIntegration.LoggingEvent();
if (innerLoggingEvent == null)
throw new Exception("Wrong Type");
Logger.Log(innerLoggingEvent.InnerLoggingEvent);
}
....
}
//Changes to ExtendedLog4netLogger Class
// -- Castle.Services.Logging.Log4netIntegration
public class ExtendedLog4netLogger
{
....
public override ILoggingEvent CreateLoggingEvent()
{
return new ExtendedLoggingEvent();
}
....
}
//New ExtendedLoggingEvent Class
// -- Castle.Services.Logging.NLogtIntegration
public class LoggingEvent : Castle.Core.Logging.LoggingEvent
{
....
//Similar implementation pattern as Log4Net version except for
nLog
....
}
//New ExtendedLoggingEvent Class
// -- Castle.Services.Logging.NLogtIntegration
public class ExtendedLoggingEvent :
Castle.Services.Logging.NLogtIntegration.LoggingEvent,
IExtendedLoggingEvent
{
....
//Similar implementation pattern as Log4Net version except for
nLog
....
}
//New LocalContextProperties Class
// -- Castle.Services.Logging.NLogtIntegration
public class LocalContextProperties : IKeyContextProperties
{
....
//Similar implementation pattern as Log4Net version except for
nLog
....
}
//Changes to NLogLogger Class
// -- Castle.Services.Logging.NLogtIntegration
public class NLogLogger
{
....
//Similar implementation pattern as Log4Net version except for
nLog
....
}
//Changes to ExtendedNLogLogger Class
// -- Castle.Services.Logging.NLogtIntegration
public class ExtendedNLogLogger
{
....
//Similar implementation pattern as Log4Net version except for
nLog
....
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---