Log.WriteEntry questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eric.goforth@gmail.com

    #1

    Log.WriteEntry questions

    Hello,

    I'm trying to write information out to a log file, I think that I'm
    missing something in my app.config file. I've put the following in
    there:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuratio n>
    <system.diagnos tics>
    <sources>
    <!-- This section defines the logging configuration for
    My.Application. Log -->
    <source name="DefaultSo urce" switchName="Def aultSwitch">
    <listeners>
    <add name="FileLog"/>
    <!-- Uncomment the below section to write to the
    Application Event Log -->
    <add name="EventLog"/>
    <add name="FileLogLi stener" />
    </listeners>
    </source>
    </sources>
    <switches>
    <add name="DefaultSw itch" value="Informat ion" />
    </switches>
    <sharedListener s>
    <add name="FileLog"

    type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
    Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
    PublicKeyToken= b03f5f7f11d50a3 a, processorArchit ecture=MSIL"
    initializeData= "FileLogWri ter" />
    <!-- Uncomment the below section and replace
    APPLICATION_NAM E with the name of your application to write to the
    Application Event Log -->
    <add name="EventLog"
    type="System.Di agnostics.Event LogTraceListene r"
    initializeData= "MyApplicat ion"/>
    <add name="FileLogLi stener"
    type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
    Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
    PublicKeyToken= b03f5f7f11d50a3 a"
    initializeData= "FileLogListene rWriter"
    location="Custo m"
    customlocation= "c:\" />

    </sharedListeners >
    </system.diagnost ics>
    </configuration>

    In the Error list I get the following warnings in my App.config file:

    The 'location' attribute is not declared.
    The 'customlocation ' attribute is not declared.

    I've put the following in my VB.NET code:

    My.Application. Log.WriteEntry( "Test")

    I see a c:\MyApplicatio n.log file get created, but nothing gets written
    to it. Any idea what's wrong?

    Thanks,
    Eric

Working...