Hi Wolfgang,
I've got it to work thanks. I didn't realise it would be that easy!!!
Thanks for pointing me in the right direction.
Matt
Wolfgang Trog wrote:
>
> Hi Mattyboy,
>
> as long as you use the same logger in all your assemblies, everything will
> be logged in the same file:
>
> ILog logger = LogManager.GetLogger("ClaymoreLogger");
> logger.Info(.....)
>
>
> Hope that helps,
> Wolfgang
>
> -----Original Message-----
> From: mattyboy [mailto:[email protected]]
> Sent: Mittwoch, 2. September 2009 10:24
> To: [email protected]
> Subject: Log4Net Repository
>
>
> Hi,
>
> I'm new to Log4Net having stumbled across it by accident. I've managed to
> get a single .Net assembly logging to a file using the
> RollingFileAppender.
> This works fine and I'm happy with it but what I REALLY want to do is have
> multiple .Net assemblies logging to the same log file. Having looked at
> the
> documentation I think I should be using a Repository to do this but I
> can't
> find any decent examples of how this is done.
>
> Can anyone supply me with any examples/urls etc. that would point me in
> the
> right direction?
>
> Many Thanks
>
>
> Here's the config. file I'm using at the moment for a single assembly:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <configSections>
> <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
> </configSections>
> <log4net>
>
> <appender name="ClaymoreAppender"
> type="log4net.Appender.RollingFileAppender">
> <file value="C:\Program Files\Claymore\Claymore.log" />
> <appendToFile value="true" />
> <rollingStyle value="Size" />
> <maxSizeRollBackups value="3" />
> <maximumFileSize value="100KB" />
> <staticLogFileName value="true" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%date [%thread] %-5level - [Claymore]
> %message%newline" />
> </layout>
> </appender>
> <logger name="ClaymoreLogger">
> <!--<level value="INFO" />-->
> <!--<level value="DEBUG" />-->
> <level value="INFO" />
> <appender-ref ref="ClaymoreAppender" />
> </logger>
> </log4net>
> </configuration>
>
>
> --
> View this message in context:
> http://www.nabble.com/Log4Net-Repository-tp25253481p25253481.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
>
>
>
>
--
View this message in context:
http://www.nabble.com/Log4Net-Repository---Use-same-log-file-for-multiple-Assemblies-tp25253481p25254926.html
Sent from the Log4net - Users mailing list archive at Nabble.com.