Smartsite.Logging.config

Smartsite 7.10 - ...

De Smartsite Manager gebruikt een "eigen" smartsite.logging.config bestand om de logging in te stellen.
Hierdoor kun je voor de manager apart logging in- of uitschakelen onafhankelijk van de logging instellingen voor de publication engine (de website zelf).

Ook het instellen van optionele filters en welke type logmeldingen naar de log geschreven moeten worden is hierdoor onafhankelijk van elkaar in te stellen.

Het logging configuratie bestand is in de praktijk vaak onnodig complex, met daarin diverse listener definities die feitelijk niet gebruikt worden.
Onderstaand een voorbeeld van een smartsite.logging.config bestand met alleen de meest noodzakelijke configuratie.

Smartsite.logging.config voorbeeld bestand

XML CopyCode image Copy Code
<?xml version="1.0" encoding="utf-8"?>
<configuration xsi:schemaLocation="http://schemas.microsoft.com/.NetConfiguration/v2.0 System/Schemas/Configuration/smartsite.logging.config.xsd" xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <configSections>
        <section name="loggingConfiguration" type="Smartsite.Diagnostics.LoggingBase.Logging.Configuration.LoggingSettings,Smartsite.Diagnostics.Logging"/>
        <section name="logwriterConfiguration" type="Smartsite.Diagnostics.Logging.LogWriterSettings,Smartsite.Diagnostics.Logging"/>
    </configSections>
    <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="" logWarningsWhenNoCategoriesMatch="true">
        <listeners>
            <add name="Database Trace Listener" type="Smartsite.Diagnostics.Logging.DBTraceListener,Smartsite.Diagnostics.Logging" dbConnection="manager" dbLogEntriesTable="LogEntries" listenerDataType="Smartsite.Diagnostics.LoggingBase.Logging.Configuration.CustomTraceListenerData,Smartsite.Diagnostics.Logging" traceOutputOptions="None" initializeData=""/>
        </listeners>
        <categorySources/>
        <specialSources>
            <allEvents switchValue="All" name="All Events">
                <listeners>
                    <add name="Database Trace Listener"/>
                </listeners>
            </allEvents>
            <notProcessed switchValue="All" name="Unprocessed Category"/>
            <errors switchValue="All" name="Logging Errors">
                <listeners/>
            </errors>
        </specialSources>
    </loggingConfiguration>
    <logwriterConfiguration>
        <logging enabled="true" type="asynchronous" queueSize="1000"/>
        <logfilter>
            <logtype name="Error" defaultminlevel="1" defaultmaxlevel="10">
                <filters>
                    <filter category="Smi" minlevel="1" maxlevel="0"/>
                </filters>
            </logtype>
            <logtype name="Warning" defaultminlevel="1" defaultmaxlevel="3">
                <filters/>
            </logtype>
            <logtype name="Information" defaultminlevel="1" defaultmaxlevel="4">
                <filters>
                    <filter category="ImageProcessor" minlevel="1" maxlevel="0"/>
                    <filter category="Spice" minlevel="1" maxlevel="0"/>
                      <filter category="PDF" minlevel="1" maxlevel="0"/>
                </filters>
            </logtype>
            <logtype name="Trace" defaultminlevel="1" defaultmaxlevel="0">
                <filters>
                    <filter category="StateSync" minlevel="1" maxlevel="0"/>
                    <filter category="Security" minlevel="1" maxlevel="0"/>
                      <filter category="PDF" minlevel="1" maxlevel="0"/>
                    <filter category="ImageProcessor" minlevel="1" maxlevel="0"/>
                    <filter category="Spice" minlevel="1" maxlevel="0"/>
                </filters>
            </logtype>
        </logfilter>
    </logwriterConfiguration>
</configuration>

Het dbConnection attribuut van de Database Trace Listener moet verwijzen naar een bestaande database connection configuratie in het Smartsite.Data configuratie bestand.

Overigens, deze versie van het smartsite.logging.config configuratie bestand kan ook zo voor de publication engine gebruikt worden.