<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user">
    <title>gmane.comp.log.log4net.user</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4965"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4964"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4963"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4962"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4961"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4960"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4959"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4958"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4957"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4956"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4955"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4954"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4953"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4952"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4951"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4950"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4949"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4948"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4947"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/4946"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4965">
    <title>RE: how to catch assembly info from calling function</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4965</link>
    <description>&lt;pre&gt;Thanks for the quick reply.

 

I was thinking of using stacktrace and will probably go with it. Although
it's not the best solution since I'm using log4net adonetadapter and wanted
to populate my table fields according to log4net output for readabillity. 

 

At least until c# 5.

 

Kind regards,

 

Alex Misca

 

From: Neil Haughton [mailto:Neil.Haughton&amp;lt; at &amp;gt;autoscribe.co.uk] 
Sent: Thursday, May 17, 2012 11:20 AM
To: Log4NET User
Subject: RE: how to catch assembly info from calling function

 

If you can wait for C# 5, you will get the Caller functions to deal with
this!

 

If not, is the call made from a static method in a class or from an instance
method of that class? If the latter, consider passing the instance and
method names as an argument (appendLog(this, "thismethodname", message,
etc.) then use reflection to discover everything you need to know about it.

 

Also you can interrogate the call stack, which is probably more elegant.
Information here:
(http://neilkilbride.blogspot.co.uk/2008/04/how-&lt;/pre&gt;</description>
    <dc:creator>Alex Misca</dc:creator>
    <dc:date>2012-05-17T08:51:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4964">
    <title>Re: how to catch assembly info from calling function</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4964</link>
    <description>&lt;pre&gt;If you're using the call stack method, do note that JIT optimization may
inline methods, causing the method names to be not what you expect.

Regards,
Chun Kit


On Thu, May 17, 2012 at 4:20 PM, Neil Haughton &amp;lt;
Neil.Haughton&amp;lt; at &amp;gt;autoscribe.co.uk&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Lee Chun Kit</dc:creator>
    <dc:date>2012-05-17T08:36:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4963">
    <title>RE: how to catch assembly info from calling function</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4963</link>
    <description>&lt;pre&gt;If you can wait for C# 5, you will get the Caller functions to deal with
this!

 

If not, is the call made from a static method in a class or from an
instance method of that class? If the latter, consider passing the
instance and method names as an argument (appendLog(this,
"thismethodname", message, etc...) then use reflection to discover
everything you need to know about it.

 

Also you can interrogate the call stack, which is probably more elegant.
Information here: (
http://neilkilbride.blogspot.co.uk/2008/04/how-to-access-call-stack-c.ht
ml

 

Best Regards,

 

Neil Haughton BSc MIET IEng(CEI)

Development Manager
Autoscribe Limited
Wellington House,
Riseley Business Park
Basingstoke Road, Riseley
Berkshire RG7 1NW
Office:   +44 (0) 118 984 0610
Fax:      +44 (0) 118 984 0611
Email:  neil.haughton&amp;lt; at &amp;gt;autoscribe.co.uk    Visit our website at: 
www.autoscribe.co.uk &amp;lt;http://www.autoscribe.co.uk/&amp;gt; 
Registered in Wales No. 1539748

  &amp;lt;https://twitter.com/#!/autoscribeltd&amp;gt; 

 

  &amp;lt;http://www.linkedin.com/comp&lt;/pre&gt;</description>
    <dc:creator>Neil Haughton</dc:creator>
    <dc:date>2012-05-17T08:20:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4962">
    <title>how to catch assembly info from calling function</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4962</link>
    <description>&lt;pre&gt;Hy,

 

I have a static function which calls logg.info or logger.debug and so on,
depending of where I call it. How can I save into log file the class and
line from where I called the function. Logger writes the class/line from the
function I created not from the call made.

 

Example:

 

In a static class

 

public static void appendLog(string messageType, string message, Exception
exc)
        {
            messageType = messageType.ToUpper();
            switch(messageType)
            {
                case "INFO":
                    {
                        if (exc == null)
                        {
                            MainForm.logger.Info(message);
                        }
                        else
                        {
                            MainForm.logger.Info(message, exc);
                        }
                        break;
                    }
                case "DEBUG":
                {
                    if (exc == null)
                    {
                &lt;/pre&gt;</description>
    <dc:creator>Alex Misca</dc:creator>
    <dc:date>2012-05-17T07:39:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4961">
    <title>Re: [problem founded] Logger not working in an ASP.Net environment only works with full trust</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4961</link>
    <description>&lt;pre&gt;

Yes, please do.  I'm not sure whether all people who'd be willing to
help are subscribed to this list.

Thanks

        Stefan

&lt;/pre&gt;</description>
    <dc:creator>Stefan Bodewig</dc:creator>
    <dc:date>2012-05-15T04:05:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4960">
    <title>Re: [problem founded] Logger not working in an ASP.Net environment only works with full trust</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4960</link>
    <description>&lt;pre&gt;I think I found what .net 4 policy doesn't like..

According to this:
http://msdn.microsoft.com/en-us/library/bb924412.aspx

Serialization in a partially-truste application should be done in
another way ([DataContract] attribute must used, you can't use
[Serializable] attribute and can't use ISerializable interface to
control the serialization process.

After removed the [Serializable] and the ISerializable interface all
work fine, but of course i "loose" all the code performed by the
implementation of the ISerializable interface.
By the way the log is fine for me now and all I need seem to work.

I thinks this need a look from some log4net dev-team guy, because now
log4net is really unusable in a partially trusted environment.

What do you think?
Should I write in dev-list about it?

Thanks and best regards
michele

Il 14/05/2012 10:18, Martin Milan ha scritto:

&lt;/pre&gt;</description>
    <dc:creator>Michele Lepri</dc:creator>
    <dc:date>2012-05-14T18:35:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4959">
    <title>Re: Logger not working in an ASP.Net environment only works with full trust</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4959</link>
    <description>&lt;pre&gt;Thanks Martin for the reply,
no I can't change the security policy cause this project must run in a
shared hosting.

I think I don't understand what I should move: the folder where I write
the log already have all the needed right, but I think what throw the
security exception is something related to this:

http://msdn.microsoft.com/en-us/library/dd233102%28VS.100%29.aspx

I will investigate deeper I can today later..

michele


Il 14/05/2012 10:18, Martin Milan ha scritto:


&lt;/pre&gt;</description>
    <dc:creator>Michele Lepri</dc:creator>
    <dc:date>2012-05-14T09:05:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4958">
    <title>RE: Logger not working in an ASP.Net environment only works with full trust</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4958</link>
    <description>&lt;pre&gt;Whilst you might not be able to change the security policy, perhaps you could get around the problem by moving whatever is being written into a different folder that would not fall afoul of it?

Martin.


-----Original Message-----
From: Michele Lepri [mailto:michele.lepri&amp;lt; at &amp;gt;gmail.com] 
Sent: 13 May 2012 19:52
To: Log4NET User
Subject: Re: Logger not working in an ASP.Net environment only works with full trust

Hello all,
I fall into the same problem: unluckily the advices of Vanitha Venkatasamy in the other reply don't solve the issue.

Adding this attribute
[assembly:
System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

like written here:
http://stackoverflow.com/questions/2279896/log4net-and-net-4-0-rc

change only the exception in:

*****
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust leve&lt;/pre&gt;</description>
    <dc:creator>Martin Milan</dc:creator>
    <dc:date>2012-05-14T08:18:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4957">
    <title>Re: Logger not working in an ASP.Net environment only works with full trust</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4957</link>
    <description>&lt;pre&gt;Hello all,
I fall into the same problem: unluckily the advices of Vanitha
Venkatasamy in the other reply don't solve the issue.

Adding this attribute
[assembly:
System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

like written here:
http://stackoverflow.com/questions/2279896/log4net-and-net-4-0-rc

change only the exception in:

*****
Description: The application attempted to perform an operation not
allowed by the security policy.  To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Security.Permissions.FileIOPermission,
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
*****

Of course I can't change the security policy.

The author of the reply say it is related to how Log4Net is written.

Any idea?
I have to open a jira issue for this?

thanks
michel&lt;/pre&gt;</description>
    <dc:creator>Michele Lepri</dc:creator>
    <dc:date>2012-05-13T18:52:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4956">
    <title>RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4956</link>
    <description>&lt;pre&gt;I am glad it helped you...

From: Lenka Rolinek [mailto:Lenka.Rolinek&amp;lt; at &amp;gt;ir.com]
Sent: Friday, May 11, 2012 12:30 AM
To: Log4NET User
Subject: RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application

Hi Vanitha,

Enabling log4net debugging help me to find the problem.

Thank you for your help,
Lenka


From: Venkatasamy, Vanitha [mailto:Vanitha.Venkatasamy&amp;lt; at &amp;gt;xpandcorp.com]
Sent: 10. května 2012 0:08
To: Log4NET User
Subject: RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application

Hi,
  I have implemented the Log4Net for .Net3.5 web application with IIS 7. Ours is multiple environment like windows 2003 iis6 ,windows 2008 iis 7 and windows7 IIS7 like that.
Below are the few suggestions you can try ,


1.       Implement the log4net in a separate dll and call it in the Global.asax.cs file like below.


    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup

log4net.Config.XmlConfigurator.Configure();

 }


       void Application_Error&lt;/pre&gt;</description>
    <dc:creator>Venkatasamy, Vanitha</dc:creator>
    <dc:date>2012-05-11T13:09:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4955">
    <title>RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4955</link>
    <description>&lt;pre&gt;Hi Vanitha,

 

Enabling log4net debugging help me to find the problem.

 

Thank you for your help,

Lenka

 

 

From: Venkatasamy, Vanitha [mailto:Vanitha.Venkatasamy&amp;lt; at &amp;gt;xpandcorp.com] 
Sent: 10. května 2012 0:08
To: Log4NET User
Subject: RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application

 

Hi, 

  I have implemented the Log4Net for .Net3.5 web application with IIS 7. Ours is multiple environment like windows 2003 iis6 ,windows 2008 iis 7 and windows7 IIS7 like that. 

Below are the few suggestions you can try ,

 

1.       Implement the log4net in a separate dll and call it in the Global.asax.cs file like below.

 

    void Application_Start(object sender, EventArgs e) 

    {

        // Code that runs on application startup

log4net.Config.XmlConfigurator.Configure();

 }

 

       void Application_Error(object sender, EventArgs e) 

       {

 

        // Code that runs when an unhandled error occurs

        string strErrorPage;        

  Exception objErr = Server.GetLastError(&lt;/pre&gt;</description>
    <dc:creator>Lenka Rolinek</dc:creator>
    <dc:date>2012-05-11T04:29:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4954">
    <title>RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4954</link>
    <description>&lt;pre&gt;Hi,
  I have implemented the Log4Net for .Net3.5 web application with IIS 7. Ours is multiple environment like windows 2003 iis6 ,windows 2008 iis 7 and windows7 IIS7 like that.
Below are the few suggestions you can try ,


1.       Implement the log4net in a separate dll and call it in the Global.asax.cs file like below.


    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup

log4net.Config.XmlConfigurator.Configure();

 }


       void Application_Error(object sender, EventArgs e)
       {

        // Code that runs when an unhandled error occurs
        string strErrorPage;

  Exception objErr = Server.GetLastError().GetBaseException();
                   dllname.ErrorLogging logger = new dllname.ErrorLogging();

strErrorPage = logger.logEventError(System.Configuration.ConfigurationManager.AppSettings["Source"].ToString(), System.Configuration.ConfigurationManager.AppSettings["Log"].ToString(),  HttpContext.Current, Request, objErr, strBotPath);

}
&lt;/pre&gt;</description>
    <dc:creator>Venkatasamy, Vanitha</dc:creator>
    <dc:date>2012-05-09T14:07:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4953">
    <title>Re: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4953</link>
    <description>&lt;pre&gt;Could it be permissions? Remember, when you run locally, you're running under your account. When you run on a remote server, it's typically configured to run under a service account. That account needs to have permission to log. Furthermore, if you're using impersonation, the STARTUP events in global.asax.cs runs under the pool account, but code on the user thread runs under the impersonated account.
 
This can be a pain to debug because l4n silently fails under a situation like this and then disables the appender for the rest of that application's lifetime.
 

________________________________
 From: Lenka Rolinek &amp;lt;Lenka.Rolinek&amp;lt; at &amp;gt;ir.com&amp;gt;
To: log4net-user&amp;lt; at &amp;gt;logging.apache.org 
Sent: Wednesday, May 9, 2012 8:03 AM
Subject: RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application
  

 
Hi, 
  
I am hoping someone can help… 
  
We have a multi assembly ASP.NET MVC 3
application that runs on IIS7.5. 
We are using log4net version 1.2.10. 
We call log4net LogManager.GetLogger(“loggerName”).Error(&lt;/pre&gt;</description>
    <dc:creator>Todd</dc:creator>
    <dc:date>2012-05-09T13:26:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4952">
    <title>RE: log4net usage in IIS7.5 ASP.NET MVC (multi assembly) application</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4952</link>
    <description>&lt;pre&gt;Hi,

 

I am hoping someone can help...

 

We have a multi assembly ASP.NET MVC 3 application that runs on IIS7.5.

We are using log4net version 1.2.10.

We call log4net LogManager.GetLogger("loggerName").Error("..."); from
all assemblies of our web application.

 

Logging from all assemblies works when we run our web application on our
development systems from MS Studio 2010.

I.e. the log contains logged information from all our application
assemblies.

 

Logging from assemblies but the main one (the one from which log4net was
registered, i.e. includes global.asax.cs file) does _NOT_ work when we
run our web application installed on IIS7.5.

I.e. the log contains logged information from the application assembly
only.

 

 

Following is a list of all log4net 'configuration parts' in our
application:

 

1.       Log4net configuration is stored in a config file dedicated for
log4net.  

The content of this file is below.

 

&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;

&amp;lt;configuration&amp;gt;

 

    &amp;lt;configSections&lt;/pre&gt;</description>
    <dc:creator>Lenka Rolinek</dc:creator>
    <dc:date>2012-05-09T12:03:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4951">
    <title>RE: Duplicate log entries with DLL/EXE combination</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4951</link>
    <description>&lt;pre&gt;private static readonly ILog DebugLog = LogManager.GetLogger(typeof(&amp;lt;yourclass&amp;gt;));
^--- this is the typical usage

http://logging.apache.org/log4net/release/manual/configuration.html

try removing the RepositoryAttribute from each assembly

http://logging.apache.org/log4net/release/sdk/log4net.Config.RepositoryAttribute.html

if that doesn't work, try programmatically getting all appenders from the default repository root logger. Shouldn't be duplicates, but I don't really know the internals of that.

Are you getting any output from log4net? (failed to configure or some such message)

-----Original Message-----
From: Kramer, Mat [mailto:MKramer&amp;lt; at &amp;gt;datasci.com] 
Sent: Friday, April 27, 2012 11:12 AM
To: Log4NET User
Subject: RE: Duplicate log entries with DLL/EXE combination

Paul,

Thanks for the response.

Each of the assemblies is configured via the following entries in the AssemblyInfo.cs file:

[assembly: log4net.Config.Repository]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "my-assembly-log4ne&lt;/pre&gt;</description>
    <dc:creator>Paul Dejardin</dc:creator>
    <dc:date>2012-04-27T15:37:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4950">
    <title>RE: Duplicate log entries with DLL/EXE combination</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4950</link>
    <description>&lt;pre&gt;Paul,

Thanks for the response.

Each of the assemblies is configured via the following entries in the AssemblyInfo.cs file:

[assembly: log4net.Config.Repository]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "my-assembly-log4net.config")]

I've tried changing the "conversionPattern" to determine which appender definition is being used.  It is always using the application's appender definition.  All output is going to the output file defined there.

Any class that needs to log will have a static member like this:

private static readonly ILog DebugLog = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

-Mat

-------
From: Paul Dejardin [mailto:pdejardin&amp;lt; at &amp;gt;factset.com] 
Sent: Friday, April 27, 2012 7:56 AM
To: Log4NET User
Subject: RE: Duplicate log entries with DLL/EXE combination

How are you configuring? (programmatically, custom attribute, etc.) My guess would be that the 'DebugAppender' is being added twice (once in two separate repositories). You could use &lt;/pre&gt;</description>
    <dc:creator>Kramer, Mat</dc:creator>
    <dc:date>2012-04-27T15:12:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4949">
    <title>RE: Duplicate log entries with DLL/EXE combination</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4949</link>
    <description>&lt;pre&gt;How are you configuring? (programmatically, custom attribute, etc.) My guess would be that the 'DebugAppender' is being added twice (once in two separate repositories). You could use the same Repository for both assemblies. How are you creating loggers in code?

From: Kramer, Mat [mailto:MKramer&amp;lt; at &amp;gt;datasci.com]
Sent: Thursday, April 26, 2012 7:02 PM
To: log4net-user&amp;lt; at &amp;gt;logging.apache.org
Subject: Duplicate log entries with DLL/EXE combination

Hello,

We have a .NET executable and a DLL assembly that both use log4net.  One of the complications is that the DLL is also called from an unmanaged C++ application and we want logging to work in that setting.  Our current solution works, but I get many duplicate log entries when I am running the .NET EXE with the .NET DLL.  The configurations are below.  Any ideas for how to fix this?  I have to admit I don't really understand how it works now.

Thanks!

Application configuration

&amp;lt;log4net&amp;gt;

  &amp;lt;appender name="DebugAppender" type="log4net.Appender.RollingFileAppender"&amp;gt;
   &lt;/pre&gt;</description>
    <dc:creator>Paul Dejardin</dc:creator>
    <dc:date>2012-04-27T12:56:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4948">
    <title>Duplicate log entries with DLL/EXE combination</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4948</link>
    <description>&lt;pre&gt;Hello,

 

We have a .NET executable and a DLL assembly that both use log4net.  One
of the complications is that the DLL is also called from an unmanaged
C++ application and we want logging to work in that setting.  Our
current solution works, but I get many duplicate log entries when I am
running the .NET EXE with the .NET DLL.  The configurations are below.
Any ideas for how to fix this?  I have to admit I don't really
understand how it works now.

 

Thanks!

 

Application configuration

 

&amp;lt;log4net&amp;gt;

 

  &amp;lt;appender name="DebugAppender"
type="log4net.Appender.RollingFileAppender"&amp;gt;

    &amp;lt;file value="log-file-fauxnemah.txt" /&amp;gt;

    &amp;lt;appendToFile value="true" /&amp;gt;

    &amp;lt;rollingStyle value="Size" /&amp;gt;

    &amp;lt;maxSizeRollBackups value="10" /&amp;gt;

    &amp;lt;maximumFileSize value="50MB" /&amp;gt;

    &amp;lt;staticLogFileName value="true" /&amp;gt;

    &amp;lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock" /&amp;gt;

    &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;

      &amp;lt;conversionPattern value="%date %7level [%2thread]
%message%newline" /&amp;gt;&lt;/pre&gt;</description>
    <dc:creator>Kramer, Mat</dc:creator>
    <dc:date>2012-04-26T23:01:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4947">
    <title>RE: RemotingAppender Problem</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4947</link>
    <description>&lt;pre&gt;Ok, that's also possible solution. But as you can see - you must call Configure() too, just on different configurator. Using of configuration file is really not necessary, you just must select appropriate configurator and configure logging system with its help
Radovan

________________________________
Od: zafer aydin [mailto:zaferaydn&amp;lt; at &amp;gt;hotmail.com]
Odesláno: 24. dubna 2012 7:14
Komu: log4net-user&amp;lt; at &amp;gt;logging.apache.org
Předmět: RE: RemotingAppender Problem

Hello Radovan;
i solved the problem in an other way. Firstly, i load an almost empty xml configuration file with the following line of code:
log4net.Config.XmlConfigurator.Configure(new FileInfo(filename));
After that i could add the appender in the way that i described in my question. I think we must first load an xml configuration to add loggers and appenders to loggers.
I simply load a config which has no appenders in it. Then, I added the appenders in code. I am using vs2008, .net 3.5 C#. The problem is now seen to be solved.
Thanks for your answer.

Fe&lt;/pre&gt;</description>
    <dc:creator>Radovan Raszka</dc:creator>
    <dc:date>2012-04-24T05:56:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4946">
    <title>RE: RemotingAppender Problem</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4946</link>
    <description>&lt;pre&gt;
Hello Radovan;i solved the problem in an other way. Firstly, i load an almost empty xml configuration file with the following line of code:log4net.Config.XmlConfigurator.Configure(new FileInfo(filename));After that i could add the appender in the way that i described in my question. I think we must first load an xml configuration to add loggers and appenders to loggers.I simply load a config which has no appenders in it. Then, I added the appenders in code. I am using vs2008, .net 3.5 C#. The problem is now seen to be solved.Thanks for your answer.
Fer

From: raszka&amp;lt; at &amp;gt;hasam.cz
To: log4net-user&amp;lt; at &amp;gt;logging.apache.org
Subject: RE: RemotingAppender Problem
Date: Mon, 23 Apr 2012 10:37:22 +0000









You must call Configure method. Here is example with file appender - rewrite it as needed

 
log4net.Appender.RollingFileAppender fa =
new log4net.Appender.RollingFileAppender(); //create appender
fa.AppendToFile = true; // set options
fa.DatePattern = ".yyyy-MM-dd.lo\\g";
fa.File = System.IO.Path.GetTempPath() + file&lt;/pre&gt;</description>
    <dc:creator>zafer aydin</dc:creator>
    <dc:date>2012-04-24T05:13:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/4945">
    <title>RE: RemotingAppender Problem</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/4945</link>
    <description>&lt;pre&gt;You must call Configure method. Here is example with file appender - rewrite it as needed



log4net.Appender.RollingFileAppender fa = new log4net.Appender.RollingFileAppender(); //create appender

fa.AppendToFile = true; // set options

fa.DatePattern = ".yyyy-MM-dd.lo\\g";

fa.File = System.IO.Path.GetTempPath() + filename;

fa.Layout = new log4net.Layout.PatternLayout("%date{dd-MM HH:mm:ss,fff} [%level] %message %n");

fa.RollingStyle = log4net.Appender.RollingFileAppender.RollingMode.Date;

fa.Threshold = log4net.Core.Level.Debug;

fa.StaticLogFileName = false;

fa.ActivateOptions(); // activate options

log4net.Config.BasicConfigurator.Configure(fa); //configure logging system



Radovan Raszka

________________________________
Od: zafer aydin [mailto:zaferaydn&amp;lt; at &amp;gt;hotmail.com]
Odesláno: 19. dubna 2012 11:05
Komu: log4net-user&amp;lt; at &amp;gt;logging.apache.org
Předmět: FW: RemotingAppender Problem

Hello,
i need to add remoting appenders to my logger to enable to send logs to multiple remoting listeners.
To achive this&lt;/pre&gt;</description>
    <dc:creator>Radovan Raszka</dc:creator>
    <dc:date>2012-04-23T10:37:22</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.log.log4net.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.log.log4net.user</link>
  </textinput>
</rdf:RDF>

