views:

33

answers:

1

The goal is to have our application specific event logs in a folder with the name of our company. So, Company/App1, Company/App2. I would prefer to accomplish this with configuration, or with very little code. I tried setting logName to "MyFolder/MyLog" to no avail.

Example of a folder in event viewer, reference the Microsoft folder

This is my current Appender configuration:

  <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
     <filter type="log4net.Filter.LevelRangeFilter">
        <levelMin value="WARN" />
        <levelMax value="FATAL" />
     </filter>         
     <applicationName value="ExampleApp" />
     <logName value="MyLog" />
     <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
     </layout>
  </appender>
A: 

You can set the path directly in the configuration, where you specify the log name, just specify the full path. You must however make sure that whatever user your application is running under has write access to that folder. Permissions are usually the cause for problems like this.

TskTsk
Can you please supply a configuration example?
Ryan P