logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Haughton" <Neil.Haugh...@autoscribe.co.uk>
Subject RE: Log4Net Repository
Date Wed, 02 Sep 2009 08:48:52 GMT
Hi all,

Which implies that the answer to the other question (how to log
different assemblies to different files) is to use a different logger in
each assembly. Is there a more elegant way?



Neil Haughton 




The contents of this email are confidential and are intended solely for
the use of the individual or company to
whom it is addressed. If you have received this email in error then
please accept our apology. If this is the case
we would be obliged if you would contact the sender and then delete this
email. Opinions expressed in this email
are those of the individual and do not necessarily represent the
opinions of Autoscribe Ltd. Although this email
and any attachments are believed to be free of any virus no
responsibility is accepted by Autoscribe Ltd for any
loss or damage arising in any way from the receipt or use of this email
or attachments.


-----Original Message-----
From: Wolfgang [mailto:wolfgang@wollinet.com] 
Sent: 02 September 2009 09:39
To: 'Log4NET User'
Subject: RE: Log4Net Repository

Hi Mattyboy,

as long as you use the same logger in all your assemblies, everything
be logged in the same file:

ILog logger = LogManager.GetLogger("ClaymoreLogger");

Hope that helps,

-----Original Message-----
From: mattyboy [mailto:mattm@spdprintsolutions.com] 
Sent: Mittwoch, 2. September 2009 10:24
To: log4net-user@logging.apache.org
Subject: Log4Net Repository


I'm new to Log4Net having stumbled across it by accident.  I've managed
get a single .Net assembly logging to a file using the
This works fine and I'm happy with it but what I REALLY want to do is
multiple .Net assemblies logging to the same log file.  Having looked at
documentation I think I should be using a Repository to do this but I
find any decent examples of how this is done.

Can anyone supply me with any examples/urls etc. that would point me in
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" ?>
    <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

    <appender name="ClaymoreAppender"
      <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" />
    <logger name="ClaymoreLogger">
      <!--<level value="INFO" />-->
      <!--<level value="DEBUG" />-->
      <level value="INFO" />
      <appender-ref ref="ClaymoreAppender" />

View this message in context:
Sent from the Log4net - Users mailing list archive at Nabble.com.

View raw message