Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > App Config
 

App Config

Hi all,

I have the following app.config file:

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

<configuration>

<system.diagnostics>

<sources>

<!-- This section defines the logging configuration for My.Application.Log -->

<source name="DefaultSource" switchName="DefaultSwitch">

<listeners>

<add name="FileLog"/>

<!-- <add name="EventLog"/> -->

</listeners>

</source>

</sources>

<switches>

<add name="DefaultSwitch" value="Information" />

</switches>

<sharedListeners>

<add name="FileLog"

type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"

initializeData="FileLogWriter"

location="custom"

traceooutputoptions="DateTime"/>

<!--<add name="EventLog"

type="System.Diagnostics.EventLogTraceListener"

initializeData="ArciveSpooler"/> -->

</sharedListeners>

</system.diagnostics>

</configuration>

The 'location' and 'traceoutputoptions' are underlined are they raise an error when running. Can I remove them, because I'm doing the following in code:

'Initialize file log

MyFileLog = My.Application.Log

With MyFileLog.DefaultFileLogWriter

.Append = True

.BaseFileName = "ArciveSpooler"

.CustomLocation = My.Application.Info.DirectoryPath

.Delimiter = vbTab

.DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.DiscardMessages

.IncludeHostName = True

.TraceOutputOptions = TraceOptions.DateTime Or TraceOptions.ProcessId Or TraceOptions.ThreadId

End With

Regards,

Ivan

Cryo75  Friday, May 04, 2007 8:25 AM
That those 2 attributes are not valid. Anyway, removing them and setting the properties in code works fine Smile
Cryo75  Friday, May 04, 2007 11:23 AM
What exception message do you receive?
iProgrammer.co.uk  Friday, May 04, 2007 9:49 AM
That those 2 attributes are not valid. Anyway, removing them and setting the properties in code works fine Smile
Cryo75  Friday, May 04, 2007 11:23 AM

You can use google to search for other answers

Custom Search

More Threads

• Make from 2 txt files one txt file
• [vb .net 2005] sending a string through a serial port rs232
• msgbox not being triggered
• Storing values from a file permanently so that the file is not necessary once compiled
• I have never seen this key on the keyboard
• Reading from a database
• Reverse referencing?
• DLL for new windows 7 features?
• Problem when trying to inherit a form as a dll
• How to disable flash in a WebBrowser?