<?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 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/3764"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3763"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3762"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3761"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3760"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3759"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3758"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3757"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3756"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3755"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3754"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3753"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3752"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3751"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3749"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3748"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3747"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3746"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3745"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.log.log4net.user/3744"/>
      </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/3764">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3764</link>
    <description>You can configure log4net anywhere - in main service EXE, in DLL which really does the job.... The only condition is to configure logging system before its first use. You can create Init() method somewhere in Logutil.dll to configure logging system and call it during application startup.
If there is problem to configure logging using app.config file, try to use the second way using separate config file to check if it works - if not, you have probably error in code related to config file location.
R


________________________________

From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src-solutions.com] 
Sent: Monday, October 06, 2008 2:23 PM
To: Log4NET User
Subject: RE: Log4net in a windows service



Radovan,

LogUtil.dll

This has some custom logging as well as log4net dll reference and uses a custom appender to log. This is where I perform

 

 

Myservice.exe has the following dll's that it uses

-          Dosomething.dl -à uses Logutil.dll and is included as a reference.

-          Myservice.exe.app.</description>
    <dc:creator>Radovan Raszka</dc:creator>
    <dc:date>2008-10-07T05:46:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3763">
    <title>Re: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3763</link>
    <description>Good idea.

2008/10/6 Francine Taylor &lt;Francine.Taylor&lt; at &gt;genesis-fs.com&gt;

</description>
    <dc:creator>Edwin McNamara</dc:creator>
    <dc:date>2008-10-06T22:36:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3762">
    <title>Re: RollingFileAppender datePattern</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3762</link>
    <description>Hi

I have managed to do that with a custom appender

Pascal

2008/10/6 Bill McCormick &lt;wpmccormick&lt; at &gt;gmail.com&gt;

</description>
    <dc:creator>Pascal ROZE</dc:creator>
    <dc:date>2008-10-06T21:58:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3761">
    <title>RollingFileAppender datePattern</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3761</link>
    <description>I have a RollingFileAppender defined as:

  &lt;appender name="XMLRollingFile" type="log4net.Appender.
RollingFileAppender"&gt;
    &lt;threshold value="DEBUG" /&gt;
    &lt;staticLogFileName value="true" /&gt;
    &lt;file value="MyLog.xml" /&gt;
    &lt;appendToFile value="true" /&gt;
    &lt;rollingStyle value="Date" /&gt;
    &lt;datePattern value="yyyyMMdd" /&gt;
    &lt;maxSizeRollBackups value="30" /&gt;
    &lt;maximumFileSize value="20MB" /&gt;
    &lt;layout type="log4net.Layout.XmlLayoutSchemaLog4j"&gt;
      &lt;locationInfo value="true" /&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;

Is there a trick to getting the backup files to be named MyLog-yyyyMMdd.xml
as opposed to MyLog.xmlyyyyMMdd?

Having staticLogFileName == false and log files named MyLog-yyyyMMdd.xml
would also be cool!!


Thanks,

Bill
</description>
    <dc:creator>Bill McCormick</dc:creator>
    <dc:date>2008-10-06T21:55:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3760">
    <title>RollingFileAppender datePattern</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3760</link>
    <description>I have a RollingFileAppender defined like so:

  &lt;appender name="XMLRollingFile"
type="log4net.Appender.RollingFileAppender"&gt;
    &lt;threshold value="DEBUG" /&gt;
    &lt;staticLogFileName value="true" /&gt;
    &lt;file value="MyLog.xml" /&gt;
    &lt;appendToFile value="true" /&gt;
    &lt;rollingStyle value="Date" /&gt;
    &lt;datePattern value="yyyyMMdd" /&gt;
    &lt;maxSizeRollBackups value="30" /&gt;
    &lt;maximumFileSize value="20MB" /&gt;
    &lt;layout type="log4net.Layout.XmlLayoutSchemaLog4j"&gt;
      &lt;locationInfo value="true" /&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;

Is there a trick to getting the backup files to be named MyLog-yyyyMMdd.xml
as opposed to MyLog.xmlyyyyMMdd?

Having staticLogFileName == false and log files named MyLog-yyyyMMdd.xml
would also be cool!!


Thanks,

Bill
</description>
    <dc:creator>Bill McCormick</dc:creator>
    <dc:date>2008-10-06T21:53:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3759">
    <title>RE: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3759</link>
    <description>What about a system where you have a "bank" of loggers?

 

First, you could have an array which would contain three values; the
generated logger name, a flag indicating whether the logger was being
used, and a task ID (empty if the logger was not being used).

 

Whenever you need a new logger, you check to see if one is available.
If not, you create it and add an entry to the logger array.

 

Either way, you just call the RemoveAllAppenders() method on that
logger, create an appender and attach it to the logger, set the task ID
for the logger, and mark it as not available.

 

________________________________

From: Mark A. DeMichele [mailto:demi&lt; at &gt;intellipro.com] 
Sent: Sunday, October 05, 2008 3:19 PM
To: Log4NET User
Subject: RE: Using log4Net to log multiple files by different
users/tasks

 

I'm not sure you're completing understanding my dilema.  I need to
basically create loggers on the fly which are associated with separate
files.

 

I did actually get something working, but now I can't figure out </description>
    <dc:creator>Francine Taylor</dc:creator>
    <dc:date>2008-10-06T20:00:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3758">
    <title>RE: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3758</link>
    <description>I've been following this thread and wanted to suggest that you consider
the possibility of using the MSMQ or ADO appenders for this purpose.
Both appenders, by the very nature of MSMQ and Database servers, allow
for multiple, simultaneous connections and would afford a seamless, high
level mechanism for gathering log messages from multiple applications,
or across multiple load balanced or clustered servers into a single,
serialized repository.

 

In the case of MSMQ, you'd need to write a very simple .NET Windows
Service application that drains the queue and serializes the log
messages into a single file (or other repository).  In the case of the
ADO.NET appender, you'd need to perform and ad-hoc query, or write a
very simple application to fetch log messages from the DB.

 

Both these solutions a little (really small) bit more work, but
ultimately, far more flexible and better suited to gathering and
distributing log messages from multiple applications and/or servers in
an enterprise environment.

 

Ken </description>
    <dc:creator>Parrish, Ken</dc:creator>
    <dc:date>2008-10-06T15:44:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3757">
    <title>RE: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3757</link>
    <description>Actually I have been looking at the code.  Sometimes it's easier to do
it in Reflector since you can easily drill down and also find where
methods are called from.  In any case, my major problem was to clean up
the ILogger objects when I was through with them.  Since that didn't
seem possible, I did as you suggested and modified my code to create
separate repositories.  One for each task.  The first problem was
checking to see if the repository existed (without catching exceptions
which are slow).   LogManager doesn't seem to have a .RespositoryExists
method, but I was able to achieve it through some typecasting.   I wound
up doing something like this.
 
ILoggerRepository loggerRep;
if
(((DefaultRepositorySelector)LoggerManager.RepositorySelector).ExistsRep
ository(TaskID.ToString())) {
  loggerRep = LogManager.GetRepository(TaskID.ToString());
} else {
  loggerRep = LogManager.CreateRepository(TaskID.ToString());
}

It isn't pretty, but it did the job.  I suggest someone add a
ExistsRepository to the LogMan</description>
    <dc:creator>Mark A. DeMichele</dc:creator>
    <dc:date>2008-10-06T14:52:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3756">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3756</link>
    <description>Radovan,

LogUtil.dll

This has some custom logging as well as log4net dll reference and uses a custom appender to log. This is where I perform

 

 

Myservice.exe has the following dll's that it uses

-          Dosomething.dl -à uses Logutil.dll and is included as a reference.

-          Myservice.exe.app.config

 

 

From your information, I assume I should do this in LogUtil.dll and in the default cstor of Logutil, I should obtain the path to the myservice.exe.app.config path and set it.

        log = LogManager.GetLogger(typeof(LogUtil)); in the cstor

 

Myservice.exe does not need to do any logging, only DoSomething library needs to perform the logging.

 

 

The error I get is a generic  .Net framework error showing all the assemblies which caused the error which may be due to versioning but the logs do not indicate this. So I did a clean install and that error was no longer the case but then it came down to just a system violation error each time I try to perform xmlconfigurator.configure() in</description>
    <dc:creator>Jeegnesh Sheth</dc:creator>
    <dc:date>2008-10-06T12:22:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3755">
    <title>Re: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3755</link>
    <description>The source code to log4net is available at:

 http://svn.apache.org/viewvc/logging/log4net/trunk/src/

If you're wondering how something works that may be a better place to look. Most (all?) of the source is commented. 

Its acceptable to create a new repository for medium to long running tasks. When you shutdown the repository it automatically shuts down all of its appenders and loggers.



----- Original Message ----
From: Mark A. DeMichele &lt;demi&lt; at &gt;intellipro.com&gt;
To: Log4NET User &lt;log4net-user&lt; at &gt;logging.apache.org&gt;
Sent: Sunday, October 5, 2008 6:19:07 PM
Subject: RE: Using log4Net to log multiple files by different users/tasks

 
I'm not sure you're completing understanding my 
dilema.  I need to basically create loggers on the fly which are associated 
with separate files.
 
I did actually get something working, but now I can't 
figure out how to clean up.  This is what I have so 
far. 
 
To start I create a repostitory and give it a name.  I 
then store the repository pointer in a static variable.
 
Then w</description>
    <dc:creator>Ron Grabowski</dc:creator>
    <dc:date>2008-10-06T03:48:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3754">
    <title>RE: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3754</link>
    <description>I'm not sure you're completing understanding my dilema.  I need to
basically create loggers on the fly which are associated with separate
files.
 
I did actually get something working, but now I can't figure out how to
clean up.  This is what I have so far. 
 
To start I create a repostitory and give it a name.  I then store the
repository pointer in a static variable.
 
Then when I start a specific task, I use the repository to create a
logger and I add a file appender to that logger.  The file appender is
associtated with a unique file name.  My task has a unique id and I used
tha same id to name the logger.  All my logging for that task uses that
logger with that name and everything seems ok.
 
Now here's the problem.  When my task is done, I would like to clean up
that logger and remove it from the repositry, but there doesn't seem to
be a way to do this.  I fear that based on my design, if my server is
running for days on end, the hash table where the loggers are stored in
the repository will grow and g</description>
    <dc:creator>Mark A. DeMichele</dc:creator>
    <dc:date>2008-10-05T22:19:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3753">
    <title>Re: Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3753</link>
    <description>In your code the File property gets set when the Appender is created. Here's an example showing how to set the File property based on each logging event:

http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/1.0/Appenders/SampleAppendersApp/cs/src/Appender/PatternFileAppender.cs?view=markup

That example code is probably slow. log4j and nlog have file appenders that keep the most recent files open so you don't have to pay the open/close penalty.

You could probably extend the FileAppender and override a method or two to do what you want.



----- Original Message ----
From: Mark A. DeMichele &lt;demi&lt; at &gt;intellipro.com&gt;
To: log4net-user&lt; at &gt;logging.apache.org
Sent: Sunday, October 5, 2008 9:43:05 AM
Subject: Using log4Net to log multiple files by different users/tasks


I have an asp.net 
site in which different users run different tasks.  Each individual task is 
managed by a TaskManager that I'm writing.  While each task is running it 
has the opportunity to log to it's own log file.  I'm trying to use Log</description>
    <dc:creator>Ron Grabowski</dc:creator>
    <dc:date>2008-10-05T15:51:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3752">
    <title>Using log4Net to log multiple files by different users/tasks</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3752</link>
    <description>I have an asp.net site in which different users run different tasks.
Each individual task is managed by a TaskManager that I'm writing.
While each task is running it has the opportunity to log to it's own log
file.  I'm trying to use Log4Net to do this, but so far I've been unable
to figure out how exactly to accomplish this.  Any advice would be
appreciated.
 
So far, I believe I must create an individual Appender for each task.
Something like this.
PatternLayout layout = new PatternLayout("%date{dd-MM-yyyy HH:mm:ss,fff}
%5level [%2thread] %message (%logger{1}:%line)%n");
FileAppender appender = new FileAppender();
appender.Layout = layout;
appender.File = "d:\\logs\\" + TaskID.ToString()+ ".txt";
appender.AppendToFile = true;
appender.Name = "File";
appender.Threshold = log4net.Core.Level.All;
appender.ActivateOptions();

And I know that eventaully, I'll want to code to call something like 

ILog _Log = LogManager.GetLogger(TaskID.ToString());

But I can't figure out how to make that logger unique and how </description>
    <dc:creator>Mark A. DeMichele</dc:creator>
    <dc:date>2008-10-05T13:43:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3751">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3751</link>
    <description>I configure log4net in main service class constructor. What kind of
crash have you met - any exception (what?) ?
public class IPservice : ServiceBase

{ ...

    public IPservice()

    {

        InitializeComponent();

        this.CanPauseAndContinue = false;

        this.CanShutdown = true;

        this.CanHandleSessionChangeEvent = false;

        this.AutoLog = false;

        this.ServiceName = IPservice.SrvName;

        XmlConfigurator.Configure();

        log = LogManager.GetLogger(typeof(IPservice));

    }

    protected override void OnStart(string[] args){ ...}

    protected override void OnStop() {...}

}


________________________________

From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src-solutions.com] 
Sent: Friday, October 03, 2008 10:36 PM
To: Log4NET User
Subject: RE: Log4net in a windows service



Radovan,

 Myservice.exe has the following:

Default cstor

 

A main entry point into process, named main

 

 

Onstart and onstop methods

 

If I place the XMlConfiguartor.confi</description>
    <dc:creator>Radovan Raszka</dc:creator>
    <dc:date>2008-10-04T20:31:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3749">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3749</link>
    <description>Radovan,

 Myservice.exe has the following:

Default cstor

 

A main entry point into process, named main

 

 

Onstart and onstop methods

 

If I place the XMlConfiguartor.configure() in any of the methods above,
my applications keeps crashing. Is there something I am missing? I am
trying to use your first solution.

 

 

Many thanks

From: Radovan Raszka [mailto:raszka&lt; at &gt;hasam.cz] 
Sent: Friday, October 03, 2008 3:58 PM
To: Log4NET User
Subject: RE: Log4net in a windows service

 

Ok, there is also dependency on where log4net is set up.

Examples in my last mail works, if log4net is configured from
Myservice.exe (not from DLL), and config is stored in
Myservice.exe.config (you add app.config to the project, but Visual
studio copies this file to the output folder as
&lt;projectname&gt;.exe.config, what is correct)

If configuration is done from DLL, then logutil.DLL.config probably can
not be used (at least it didn't work for me and I was told that
application file is always searched as &lt;processname&gt;.exe.confi</description>
    <dc:creator>Jeegnesh Sheth</dc:creator>
    <dc:date>2008-10-03T20:36:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3748">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3748</link>
    <description>Ok, there is also dependency on where log4net is set up.
Examples in my last mail works, if log4net is configured from
Myservice.exe (not from DLL), and config is stored in
Myservice.exe.config (you add app.config to the project, but Visual
studio copies this file to the output folder as
&lt;projectname&gt;.exe.config, what is correct)
If configuration is done from DLL, then logutil.DLL.config probably can
not be used (at least it didn't work for me and I was told that
application file is always searched as &lt;processname&gt;.exe.config), so
save config into Myservice.exe.config or use second example.
Radovan


________________________________

From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src-solutions.com] 
Sent: Friday, October 03, 2008 9:22 PM
To: Log4NET User
Subject: RE: Log4net in a windows service



Radovan,

            This is how my application is set up

 

LogUtil.dll

This has some custom logging as well as log4net dll reference
and uses a custom appender to log

 

 

Myservice.exe has the following</description>
    <dc:creator>Radovan Raszka</dc:creator>
    <dc:date>2008-10-03T19:57:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3747">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3747</link>
    <description>Radovan,

            This is how my application is set up

 

LogUtil.dll

This has some custom logging as well as log4net dll reference and uses a
custom appender to log

 

 

Myservice.exe has the following dll's that it uses

-          Logutil.dll

-          Dosomething.dl

-          Myservice.exe.app.config

 

Dosomthing.dll instantiates logutil.dll to write the logs.

 

I tried putting your xmlconfigurator.configure in logutil.dll and that
did not work

 

I then tried placing it in dosomething.dll which did not work

 

Placing it in myservice.exe did not produce anything

 

Thoughts/ suggestions?

 

From: Radovan Raszka [mailto:raszka&lt; at &gt;hasam.cz] 
Sent: Friday, October 03, 2008 10:41 AM
To: Log4NET User
Subject: RE: Log4net in a windows service

 

there are 2 option:

1/ XmlConfigurator.Configure();

this configures log4net using app.config file, which must be in this
form:

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

&lt;configuration&gt;

    &lt;configSections&gt;

        &lt;section name="log4net"
type="lo</description>
    <dc:creator>Jeegnesh Sheth</dc:creator>
    <dc:date>2008-10-03T19:21:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3746">
    <title>Re: Composite rollingStyle</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3746</link>
    <description>Anybody have any idea on this?

Thanks!!

On Thu, Oct 2, 2008 at 1:39 PM, Bill McCormick &lt;wpmccormick&lt; at &gt;gmail.com&gt;wrote:



</description>
    <dc:creator>Bill McCormick</dc:creator>
    <dc:date>2008-10-03T15:06:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3745">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3745</link>
    <description>It is local to the service and is placed in c:\program
files\myservice\log4net.dll

 

Yes I enabled the internal debugging and added the section to write to
file at c:\temp\log4nettest.txt and nothing is created

 

From: CLaco&lt; at &gt;SummitRacing.com [mailto:CLaco&lt; at &gt;SummitRacing.com] 
Sent: Friday, October 03, 2008 10:38 AM
To: log4net-user&lt; at &gt;logging.apache.org
Subject: RE: Log4net in a windows service

 

Had you tried enabling lob4net debugging?

 

Is log4net local  to your service dll, or do you have it installed itno
the GAC?

 


________________________________


From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src-solutions.com] 
Sent: Friday, October 03, 2008 10:30 AM
To: Log4NET User
Subject: RE: Log4net in a windows service

Chris,

 My config file has the same name myservice.dll.config and I was
hoping that the same attributes you have would work. 

 

From: CLaco&lt; at &gt;SummitRacing.com [mailto:CLaco&lt; at &gt;SummitRacing.com] 
Sent: Friday, October 03, 2008 10:27 AM
To: log4net-user&lt; at &gt;logging.apache.org
Subject: RE: Log4</description>
    <dc:creator>Jeegnesh Sheth</dc:creator>
    <dc:date>2008-10-03T14:39:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3744">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3744</link>
    <description>there are 2 option:
1/ XmlConfigurator.Configure();
this configures log4net using app.config file, which must be in this
form:
&lt;?xml version="1.0" encoding="utf-8" ?&gt;

&lt;configuration&gt;

    &lt;configSections&gt;

        &lt;section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt;

    &lt;/configSections&gt;

    &lt;appSettings&gt;

....

    &lt;/appSettings&gt;

    &lt;log4net&gt;

....

    &lt;/log4net&gt;

&lt;/configuration&gt;

This is probably best solution as you have only one config file for both
application and log4net.

2/ configure log4net using extra XML file

XmlConfigurator.Configure(new System.IO.FileInfo(GetAppPath() +
"log4net.xml"))

.....

public string GetAppPath()

{

string myPath =
System.Reflection.Assembly.GetExecutingAssembly().Location;

int i = myPath.LastIndexOf('\\');

return myPath.Remove(i + 1);

}

Both solutions works well with service, but when log4net config is
changed, you must restart your service.

 

________________________________

From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src</description>
    <dc:creator>Radovan Raszka</dc:creator>
    <dc:date>2008-10-03T14:41:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.log.log4net.user/3743">
    <title>RE: Log4net in a windows service</title>
    <link>http://permalink.gmane.org/gmane.comp.log.log4net.user/3743</link>
    <description>Had you tried enabling lob4net debugging?
 
Is log4net local  to your service dll, or do you have it installed itno
the GAC?


________________________________

From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src-solutions.com] 
Sent: Friday, October 03, 2008 10:30 AM
To: Log4NET User
Subject: RE: Log4net in a windows service



Chris,

 My config file has the same name myservice.dll.config and I was
hoping that the same attributes you have would work. 

 

From: CLaco&lt; at &gt;SummitRacing.com [mailto:CLaco&lt; at &gt;SummitRacing.com] 
Sent: Friday, October 03, 2008 10:27 AM
To: log4net-user&lt; at &gt;logging.apache.org
Subject: RE: Log4net in a windows service

 

I run a service with log4net just fine using:

 

&lt;Assembly: log4net.Config.XmlConfigurator(Watch:=True)&gt; 

The app.config nithe service project get's turned into
myservice.dll.config that sites beside of myservice.dll.

For me, it just works.

 

-=Chris


________________________________


From: Jeegnesh Sheth [mailto:jsheth&lt; at &gt;src-solutions.com] 
Sent: Friday,</description>
    <dc:creator>CLaco&lt; at &gt;SummitRacing.com</dc:creator>
    <dc:date>2008-10-03T14:38:07</dc:date>
  </item>
  <textinput 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>
