logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang, Jason @ Newport MacArthur" <Jason.W...@cbre.com>
Subject RE: Windows Service
Date Tue, 12 Jul 2005 21:49:51 GMT
All,

 

      Per Erik's suggestion I turned on debugging and downloaded
sysinternal's DebugView and found the following 2 entries:

 

[2136] log4net: DefaultRepositorySelector: defaultRepositoryType
[log4net.Repository.Hierarchy.Hierarchy] 

[2136] log4net: DefaultRepositorySelector: creating repository for assembly
[EmailService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] 

[2136] log4net: DefaultRepositorySelector: assembly [EmailService,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using domain
[log4net-default-domain] and repository type
[log4net.Repository.Hierarchy.Hierarchy] 

[2136] log4net: DefaultRepositorySelector: creating repository for domain
[log4net-default-domain] using type [log4net.Repository.Hierarchy.Hierarchy]


[2136] log4net:ERROR Logger: No appenders could be found for logger
[Company.Project.EmailService.EmailServiceStarter] 

[2136] log4net:ERROR Logger: Please initialize the log4net system properly.

 

 

      Below is my EmailService.exe.config.  What am I missing?

 

Thanks,

 

Jason

 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

      <configSections>

            <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

      </configSections>

      <appSettings>

            <add key="runinterval" value="60000" />

      </appSettings>    

      <log4net debug="true">

            <!-- Define some output appenders -->

            <appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">

                  <file value="c:\EmailSerivceLog.txt" />

                  <appendToFile value="true" />

                  <maxSizeRollBackups value="5" />

                  <maximumFileSize value="100" />

                  <rollingStyle value="Size" />

                  <staticLogFileName value="true" />

                  <layout type="log4net.Layout.PatternLayout">

                        <header value="[Header]&#13;&#10;" />

                        <footer value="[Footer]&#13;&#10;" />

                        <conversionPattern value="%date [%thread] %-5level
%logger [%ndc] - %message%newline" />

                  </layout>

            </appender>

            <appender name="EventLogAppender"
type="log4net.Appender.EventLogAppender" >

                  <applicationName value="APT - Email Service" />

                  <layout type="log4net.Layout.PatternLayout">

                        <conversionPattern value="%date [%thread] %-5level
%logger [%property{NDC}] - %message%newline" />

                  </layout>

            </appender>

            <!-- Setup the root category, add the appenders and set the
default level -->

            <root>

                  <level value="DEBUG" />

                  <appender-ref ref="EventLogAppender" />

                  <appender-ref ref="RollingLogFileAppender" />

            </root>

      </log4net>

</configuration>

  _____  

From: Sargent, Erik [mailto:Erik.Sargent@providence.org] 
Sent: Tuesday, July 12, 2005 1:55 PM
To: Log4NET User
Subject: RE: Windows Service

 

Try debugging to see if you are getting configured right. Make sure the
config file is getting read properly.

 

If the event log AND the file logging both fail, that points to something
higher in the tree.

 

and enable debugging on log4net.

 

  _____  

From: Wang, Jason @ Newport MacArthur [mailto:Jason.Wang@cbre.com] 
Sent: Tuesday, July 12, 2005 1:53 PM
To: 'Log4NET User'
Subject: RE: Windows Service

Brette,

            What about Windows Service using the rolling file appender?  If
the exe I registered as a Windows Service is stored in C:\MyService,
technically, the log file should be created in there as well right?  What
stumps me is that Filemon from Sysinternals did not detect any permission
denied tries that may indicate some sorts of a user/file permission cause.

Thanks,

Jason

            

  _____  

From: Esterbrooks, Brette [mailto:BGEsterbrooks@landolakes.com] 
Sent: Tuesday, July 12, 2005 12:30 PM
To: Log4NET User
Subject: RE: Windows Service

 

I have run into this problem when trying to log to event log. It ended up
being that the user that was running log4net did not have access to log to
the event log. Have you tried taking out the event log appender and seeing
if the file appender is working?

 

Brette

-----Original Message-----
From: Wang, Jason @ Newport MacArthur [mailto:Jason.Wang@cbre.com] 
Sent: Tuesday, July 12, 2005 2:23 PM
To: 'log4net-user@logging.apache.org'
Subject: Windows Service

I'm having trouble getting log4net working in my Windows Service
application.  Root is setup to use both event log appender and rolling log
file appender but nothing is logged  (No exception thrown either).  What is
the best way to troubleshoot?

 

Thanks,

 

Jason

DISCLAIMER:
This message is intended for the sole use of the addressee, and may contain
information that is privileged, confidential and exempt from disclosure
under applicable law. If you are not the addressee you are hereby notified
that you may not use, copy, disclose, or distribute to anyone the message or
any information contained in the message. If you have received this message
in error, please immediately advise the sender by reply email and delete
this message.


Mime
View raw message