Do you mean to say that you're trying to use the logging facility
outside of an area that has direct access to the container?
If that is what you're trying to do, I usually use a wrapper around the
logging facility to make it accessible globally:
---------------------------
namespace Common
{
using System;
using Castle.Services.Logging;
public class LogFactory
{
private static ILoggerFactory factory;
public static ILoggerFactory Factory
{
get { return factory; }
set { factory = value; }
}
public static ILogger Create(Type type)
{
return factory.Create(type);
}
public static ILogger Create(string name)
{
return factory.Create(name);
}
public static ILogger Create(Type type, LoggerLevel
level)
{
return factory.Create(type, level);
}
public static ILogger Create(string name, LoggerLevel
level)
{
return factory.Create(name, level);
}
}
}
---------------------------
So, it then becomes quite easy to create a logger:
ILogger log = LogFactory.Create(typeof(SomeClass));
HTH
- Richard
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Shawn Hinsey
Sent: Thursday, July 27, 2006 11:56 AM
To: [email protected]
Subject: [Castle-users] Logging facility
I'm having a tough time with the logging facility.
What controls the logger's name? All of my loggers seem to come back
named "Default," and CreateChildLogger(string) throws a
NotImplementedException for log4net. How do I maintain control over the
name of my loggers while still using them outside of the container?
Thanks,
Shawn
------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users