1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team-Mitglieder
    4. Trophäen
    5. Mitgliedersuche
  4. Tutorial Bereich
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Seiten
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. Informatik Forum
  2. Mitglieder
  3. Alter Schwede

Beiträge von Alter Schwede

  • Log4Net

    • Alter Schwede
    • 1. September 2008 um 14:06

    Das problem hat sich durch ein redesign gelöst. verwende nun ein eigenständiges config file für die log4net konfiguration und das funktioniert problemlos

  • Log4Net

    • Alter Schwede
    • 1. September 2008 um 12:07

    Hallo,
    Ich hab ein Ähnliches Problem und finde keine Lösung. Ich bekomme zur Laufzeit folgenden Fehler:

    Error: log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
    log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

    Mein Assembly file:

    Code
    [assembly: log4net.Config.XmlConfigurator()]



    Mein app.config:

    HTML
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <configSections>
    <sectionGroup name="applicationSettings">
    ....
    </sectionGroup>
     
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> 
    </configSections>
     
    <log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
    <file value="C:\logfile.txt" />
    <appendToFile value="true" />
    <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
    </layout>
    </appender>
     
    <root>
    <level value="DEBUG" />
    <appender-ref ref="FileAppender" />
    </root>
    </log4net>
     
    <applicationSettings>
    ...
     
    </applicationSettings>
    </configuration>
    Alles anzeigen



    mein c# code:

    Code
    [size=10][COLOR=#0000ff][size=10][COLOR=#0000ff]public [/COLOR][/SIZE][size=10][COLOR=#0000ff]class [/COLOR][/SIZE][size=10][COLOR=#2b91af]InputChannelManager[/COLOR][/SIZE]
    [size=10]{[/SIZE]
    [size=10][COLOR=#0000ff]private [/COLOR][/SIZE][size=10][COLOR=#0000ff]static [/COLOR][/SIZE][size=10][COLOR=#0000ff]readonly [/COLOR][/SIZE][size=10][COLOR=#2b91af]ILog[/COLOR][/SIZE][size=10] log = [/SIZE][size=10][COLOR=#2b91af]LogManager[/COLOR][/SIZE][size=10].GetLogger([/SIZE][size=10][COLOR=#0000ff]typeof[/COLOR][/SIZE][size=10]([/SIZE][size=10][COLOR=#2b91af]InputChannelManager[/COLOR][/SIZE][size=10]));[/SIZE]
    [size=10][COLOR=#0000ff]public[/COLOR][/SIZE][size=10] InputChannelManager()[/SIZE]
    [size=10]{[/SIZE]
    [size=10]log4net.Config.[/SIZE][size=10][COLOR=#2b91af]XmlConfigurator[/COLOR][/SIZE][size=10].Configure();[/SIZE]
    [size=10]log.Debug ([/SIZE][size=10][COLOR=#a31515]"This is a logtest for InputManager"[/COLOR][/SIZE][size=10]);[/SIZE]
    [size=10][COLOR=#0000ff]this[/COLOR][/SIZE][size=10].InitialzeFileWatchers();[/SIZE]
    [size=10]}[/SIZE]
    [/COLOR][/SIZE]


    Ich hab schon diverseste varianten ausprobiert in der app.config und im assembly alle mit dem gleichen resultat :o(

Rechtliches

Impressum

Datenschutzerklärung