Hi all,
I want to have 2 or more loggers in the same container, in order
different components in the same container can be configured with
different loggers. It MUST be made via binsor or xml.
In code works like:
.Register(
Component.For<ILogger>().Named("ch_logger").Instance(new Log4netFactory
(_logConfigFile).Create("lo4net.LogManager_return")),
Component.For<ILogger>().Named
("service_logger").ImplementedBy<ConsoleLogger>()
);
Unfortunately, the following problems come out via binsor or xml:
1° I cannot register the Log4netLogger in the container, because the
ILogger, Log4netFactory properties are required to be activated for
the container and i have no idea how to get the ILogger property.
public Log4netLogger(ILogger logger, Log4netFactory factory)
{
Logger = logger;
Factory = factory;
}
2° I don´t know exactly whether there is a way to call the Instance
method of the Component from castle xml configuration files or binsor
(i could not do it)
3° I was trying to get it working with the SupportFacility, but as
shown below, exception comes out. You could see it in the forum:
http://forum.castleproject.org/viewtopic.php?p=14536#14536
facility FactorySupportFacility
component 'log4netfactory', ILoggerFactory, Log4netFactory:
configFile = 'MYPATH\\config2.log4net'
component 'ch_logger', ILogger, Log4netLogger:
@factoryId='log4netfactory'
@factoryCreate='Create'
parameters:
name='egal'
4° It could be made via child container, but it is highly disallowed
because it makes the container configuration more complex, as many new
loggers are inserted.
I didn't find any examples or hints how to do that, at this moment, i
cannot figure out how to get it working.
Thanks and regards.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---