Quantcast
Channel: patterns & practices – Enterprise Library
Viewing all 1928 articles
Browse latest View live

New Post: Dynamically Change Log File Name in each run

$
0
0
Thanks to the stimulant and the much needed break that I took before looking at this issue again today. I think I have finally solved this issue. I wasn't very sure that this would be so easy with Enterprise Library 6.0

here is what I did to my code:
            IConfigurationSource configSource = ConfigurationSourceFactory.Create();
            var logSettings = configSource.GetSection(LoggingSettings.SectionName) as LoggingSettings;

            var loggingXmlConfigSource = new SerializableConfigurationSource();
            loggingXmlConfigSource.Add(LoggingSettings.SectionName, logSettings);

            SetNewFileName(logSettings);

            //just this line needs to be added to use the new settings
            Logger.SetLogWriter(new LogWriterFactory(loggingXmlConfigSource).Create());

            Logger.Write("Test", "General");
I ran few instances of the program simultaneously and too my utter delight each one have created its own log file and was writing to it successfully!!

Created Unassigned: Tracing to LogSource 'General' failed.... [33842]

$
0
0
I've got a service using logging producing an error message but then logging successfully to a rolling file. If the service account runs as an admin, the error doesn't happen. As soon as I remove administrative rights from the service account, an error happens again. No specific information is given helping to identify the error cause.
> Message: Tracing to LogSource 'General' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.
Summary for Enterprise Library Distributor Service:
======================================
-->
Message:
Timestamp: 1/12/2015 8:55:33 PM
Message: Service started
Category: General
Priority: 1
EventId: 1
Severity: Start
Title:
Machine: DVNSB1
App Domain: NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=6.0.0.0, Culture=neutral, PublicKeyToken=***
ProcessId: 1488
Process Name: [my process name]
Thread Name:
Win32 ThreadId:3572
Extended Properties:
--> MachineName: [my machine name]
--> TimeStamp: 1/12/2015 8:55:33 PM
--> FullName: Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
--> AppDomainName: NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c
--> WindowsIdentity: [domain]\[service account name]

Exception Information Details:
======================================
Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Data: System.Collections.ListDictionaryInternal
TargetSite: Boolean UpdateRollingInformationIfNecessary()
HelpLink: NULL
Source: Microsoft.Practices.EnterpriseLibrary.Logging
HResult: -2147467261

StackTrace Information Details:
======================================
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.UpdateRollingInformationIfNecessary()
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.AsynchronousTraceListenerWrapper.<>c__DisplayClassd.<TraceData>b__b(TraceListener tl)

Here is configuration:
```

<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source=Publisher" formatter="Text Formatter"
log="" machineName="." traceOutputOptions="None" filter="Information"
asynchronous="true" />
<add name="Email Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
toAddress="address@domain.com" fromAddress="from@myApp"
subjectLineStarter="(DevDeployment) Publisher"
subjectLineEnder=" " smtpServer="[mySmtp]" formatter="Email Formatter"
traceOutputOptions="Callstack" filter="Warning" asynchronous="true" />
<add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
rollInterval="Day" asynchronous="true" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp(local)}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
name="Text Formatter" />
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp(local)}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
name="Email Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Event Log Listener" />
<add name="Email Trace Listener" />
<add name="Rolling Flat File Trace Listener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category">
<listeners>
<add name="Email Trace Listener" />
</listeners>
</notProcessed>
<errors switchValue="All" name="Logging Errors &amp; Warnings">
<listeners>
<add name="Event Log Listener" />
<add name="Email Trace Listener" />
<add name="Rolling Flat File Trace Listener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
```

Any pointer on what I can look at?
Thanks

New Post: Rolling Log Listener stops logging whenever its companion Database Trace Listener starts to fail

$
0
0
I have a C# window service application that implements both a EntLib 5.0 Rolling Log Listener and a MS SQL 2012 Database Trace Listener when deployed on Windows 7. Typically the service logs to both listeners without any problems. However whenever the database bogs down (starts failing for any reason - typically - disk full type errors) the rolling log listener used as a backup also fails. We had hoped to display the database failures as a backup strategy. Is there a way to overcome this? I and including my config.

Thanks

<?xml version="1.0"?>
<!--Copyright (c) Microsoft Corporation. All Rights Reserved.--><configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
  <add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    source="Enterprise Library Logging" formatter="Text Formatter"
    log="" machineName="." traceOutputOptions="None" />
  <add name="RollingLogListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    fileName="C:\logs\EllipsisDataLoader.log" footer="----------------------------------------"
    formatter="Text Formatter (log files)" header="----------------------------------------"
    rollFileExistsBehavior="Increment" rollInterval="Day" rollSizeKB="32768"
    maxArchivedFiles="30" traceOutputOptions="DateTime, Timestamp" />
  <add name="XML Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.XmlTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.XmlTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    fileName="c:\EllipsisDataLoader.xml" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
  <add name="Database Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    databaseInstanceName="ELLIPSISConnectionString" writeLogStoredProcName="WriteLog"
    addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
    traceOutputOptions="DateTime, Timestamp, Callstack" />
</listeners>
<formatters>
  <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    template="{dictionary({key} - {value}|)}" name="Text Formatter" />
  <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    template= "{dictionary({key}:{value}|)}{timestamp(local)}:{machine}:{appDomain}:{category}:{priority}{newline} Message: {message}"
    name="Text Formatter (log files)" />
</formatters>
<logFilters>
  <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.LogEnabledFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    enabled="true" name="Logging Enabled Filter" />
  <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    minimumPriority="4" name="Priority Filter" />
</logFilters>
<categorySources>
  <add switchValue="All" name="General">
    <listeners>
      <add name="RollingLogListener" />
      <add name="Database Trace Listener" />
    </listeners>
  </add>
</categorySources>
<specialSources>
  <allEvents switchValue="All" name="All Events" />
  <notProcessed switchValue="All" name="Unprocessed Category" />
  <errors switchValue="All" name="Logging Errors &amp; Warnings" />
</specialSources>
</loggingConfiguration>
<exceptionHandling>
<exceptionPolicies>
  <add name="Service Policy">
    <exceptionTypes>
      <add name="SecurityException" type="System.Security.SecurityException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="ThrowNewException">
        <exceptionHandlers>
          <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            logCategory="General" eventId="100" severity="Error" title="Security Exception in Service Layer"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="2" />
          <add name="Replace Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            exceptionMessage="Unauthorized Access" replaceExceptionType="System.Security.SecurityException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        </exceptionHandlers>
      </add>
    </exceptionTypes>
  </add>
  <add name="REL Policy">
    <exceptionTypes>
      <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="NotifyRethrow">
        <exceptionHandlers>
          <add name="Logging Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging"
            logCategory="General" eventId="100" severity="Error" title="REL Policy Exception Handling"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="4" useDefaultLogger="false" />
        </exceptionHandlers>
      </add>
      <add name="SecurityException" type="System.Security.SecurityException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="NotifyRethrow">
        <exceptionHandlers>
          <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            logCategory="General" eventId="100" severity="Error" title="Security Exception in UI Layer"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="4" />
        </exceptionHandlers>
      </add>
    </exceptionTypes>
  </add>
  <add name="Unhandled Policy">
    <exceptionTypes>
      <add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        postHandlingAction="None">
        <exceptionHandlers>
          <add name="Logging Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging"
            logCategory="General" eventId="100" severity="Error" title="Unhandled Policy Exception Handling"
            formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
            priority="4" useDefaultLogger="false" />
        </exceptionHandlers>

Commented Unassigned: Tracing to LogSource 'General' failed.... [33842]

$
0
0
I've got a service using logging producing an error message but then logging successfully to a rolling file. If the service account runs as an admin, the error doesn't happen. As soon as I remove administrative rights from the service account, an error happens again. No specific information is given helping to identify the error cause.
> Message: Tracing to LogSource 'General' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.
Summary for Enterprise Library Distributor Service:
======================================
-->
Message:
Timestamp: 1/12/2015 8:55:33 PM
Message: Service started
Category: General
Priority: 1
EventId: 1
Severity: Start
Title:
Machine: DVNSB1
App Domain: NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=6.0.0.0, Culture=neutral, PublicKeyToken=***
ProcessId: 1488
Process Name: [my process name]
Thread Name:
Win32 ThreadId:3572
Extended Properties:
--> MachineName: [my machine name]
--> TimeStamp: 1/12/2015 8:55:33 PM
--> FullName: Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
--> AppDomainName: NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c
--> WindowsIdentity: [domain]\[service account name]

Exception Information Details:
======================================
Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Data: System.Collections.ListDictionaryInternal
TargetSite: Boolean UpdateRollingInformationIfNecessary()
HelpLink: NULL
Source: Microsoft.Practices.EnterpriseLibrary.Logging
HResult: -2147467261

StackTrace Information Details:
======================================
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.UpdateRollingInformationIfNecessary()
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.AsynchronousTraceListenerWrapper.<>c__DisplayClassd.<TraceData>b__b(TraceListener tl)

Here is configuration:
```

<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source=Publisher" formatter="Text Formatter"
log="" machineName="." traceOutputOptions="None" filter="Information"
asynchronous="true" />
<add name="Email Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
toAddress="address@domain.com" fromAddress="from@myApp"
subjectLineStarter="(DevDeployment) Publisher"
subjectLineEnder=" " smtpServer="[mySmtp]" formatter="Email Formatter"
traceOutputOptions="Callstack" filter="Warning" asynchronous="true" />
<add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
rollInterval="Day" asynchronous="true" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp(local)}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
name="Text Formatter" />
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp(local)}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
name="Email Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Event Log Listener" />
<add name="Email Trace Listener" />
<add name="Rolling Flat File Trace Listener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category">
<listeners>
<add name="Email Trace Listener" />
</listeners>
</notProcessed>
<errors switchValue="All" name="Logging Errors &amp; Warnings">
<listeners>
<add name="Event Log Listener" />
<add name="Email Trace Listener" />
<add name="Rolling Flat File Trace Listener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
```

Any pointer on what I can look at?
Thanks
Comments: I've figured it out. The service account didn't have modify rights to the folder where the log file was. What confused me was the fact that the file had log entries in it. Apparently, the account had __create__ rights but no __modify__ rights. So the new file was created with some initial log entries and that is what I saw. When the service was trying to add to the existing file, it failed due to lack of modify rights.

Edited Unassigned: Tracing to LogSource 'General' failed.... [33842]

$
0
0
I've got a service using logging producing an error message but then logging successfully to a rolling file. If the service account runs as an admin, the error doesn't happen. As soon as I remove administrative rights from the service account, an error happens again. No specific information is given helping to identify the error cause.
> Message: Tracing to LogSource 'General' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.
Summary for Enterprise Library Distributor Service:
======================================
-->
Message:
Timestamp: 1/12/2015 8:55:33 PM
Message: Service started
Category: General
Priority: 1
EventId: 1
Severity: Start
Title:
Machine: DVNSB1
App Domain: NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=6.0.0.0, Culture=neutral, PublicKeyToken=***
ProcessId: 1488
Process Name: [my process name]
Thread Name:
Win32 ThreadId:3572
Extended Properties:
--> MachineName: [my machine name]
--> TimeStamp: 1/12/2015 8:55:33 PM
--> FullName: Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
--> AppDomainName: NServiceBus.Hosting.Windows.WindowsHost, NServiceBus.Host, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c
--> WindowsIdentity: [domain]\[service account name]

Exception Information Details:
======================================
Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Data: System.Collections.ListDictionaryInternal
TargetSite: Boolean UpdateRollingInformationIfNecessary()
HelpLink: NULL
Source: Microsoft.Practices.EnterpriseLibrary.Logging
HResult: -2147467261

StackTrace Information Details:
======================================
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.UpdateRollingInformationIfNecessary()
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
at Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.AsynchronousTraceListenerWrapper.<>c__DisplayClassd.<TraceData>b__b(TraceListener tl)

Any pointer on what I can look at?
Thanks

New Post: Install instrumentation with EL 5 and EL 6

$
0
0
Hello, before i broke something i would like to ask:

In our IIS 7.5 we have apps that use EL 5 and others that use EL 6, all assemblies installed from Nuget packages.

Now i want install instrumentation in the server, how should i proceed ?
I need to install both 5 and 6 ?

Any guidance on this scenario would be helpful.

Thanks!

New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging

$
0
0
Here's the config file. Are we missing some other property in one of the elements?
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw SemanticLogging-svc.xsd">

  <traceEventService/>

  <sinks>
    <!--TokenEventSource-->
    <rollingFlatFileSink fileName="C:\TokenEventSource.txt" name="TokenEventSource" rollSizeKB="5">
      <sources>
        <eventSource name="Namespace.TokenEventSource"
                     level="LogAlways" />
      </sources>
    </rollingFlatFileSink>

    <!--SecurityEventSource-->
    <rollingFlatFileSink fileName="C:\SecurityEventSource.txt" name="SecurityEventSource" rollSizeKB="5">
      <sources>
        <eventSource name="Namespace.SecurityEventSource"
                     level="LogAlways" />
      </sources>
    </rollingFlatFileSink>

    <!--HttpClientEventSource-->
    <rollingFlatFileSink fileName="C:\HttpClientEventSource.txt" name="HttpClientEventSource" rollSizeKB="5">
      <sources>
        <eventSource name="Namespace.HttpClientEventSource"
                     level="LogAlways" />
      </sources>
    </rollingFlatFileSink>

    <!--HttpEventSource-->
    <rollingFlatFileSink fileName="C:\HttpEventSource.txt" name="HttpEventSource" rollSizeKB="5">
      <sources>
        <eventSource name="Namespace.HttpEventSource"
                     level="Informational" />
      </sources>
    </rollingFlatFileSink>

    <!--ServicesEventSource-->
    <rollingFlatFileSink fileName="C:\ServicesEventSource.txt" name="ServicesEventSource" rollSizeKB="5">
      <sources>
        <eventSource name="Namespace.ServicesEventSource"
                     level="LogAlways" />
      </sources>
    </rollingFlatFileSink>

    <!--ExceptionEventSource-->
    <rollingFlatFileSink fileName="C:\ExceptionEventSource.txt" name="ExceptionEventSource" rollSizeKB="5">
      <sources>
        <eventSource name="Namespace.ExceptionEventSource"
                     level="LogAlways" />
      </sources>
    </rollingFlatFileSink>
  </sinks>
</configuration>

New Post: Updating to version 6 question: Can you create a database from an open Sql Connection?

$
0
0
I have been using version 4 of this Application Block for data in my project

Rad Studio Code Generation Toolkit until today I got brave and I am updating to version 6.
http://radstudio.codeplex.com - currently it is version 5.2 but I am working on version 6 for that to be in sync with Enterprise Library.

I looked at version 5 along time ago and put it off but it is 2015 and I learned how to create
Nuget packages yesterday so I figure today I will update to Enterprise Library 6.

Now for my question which I forgot already:

In the old version there was a class called SqlHelper that went away. I learned how to use
the new version and create a database object that takes a connection string as a parameter.

In my current system I open the connection, execute the procedure and close the connection; it looks like the new version manages that for you is that correct?

Before I reorganize my code generators to not open the connection and not close it I want to ask is there a way to pass in an open SqlConnection to the CreateDatabase instead of a connection string.

Ultimately I may take out the code that opens and closes the connection but the less painful upgrade is just to pass in an open connection to create the database. Or if anyone has bothered to update the old SqlHelper class I liked it as it was all I need.

Thanks

New Post: Bring Back SQLHelper Class

$
0
0
Why would you break backwards compatibility when you upgraded?

My open source project is still using version 4 because you got rid of the class in version 5 and now I can't get my project to work with the new version.

Open source doesn't pay well enough to have to fix code because you broke compatibility.

Version 4 worked well enough so I guess I will stay on that.

New Post: Bring Back SQLHelper Class

New Post: Bring Back SQLHelper Class

$
0
0
I added the class in and it works, so I was coming here to delete this but don't see a way.

My app source code generator only executes stored procedures so it works.

I may not even need the Enterprise Library reference then.

New Post: Bring Back SQLHelper Class

$
0
0
If you are only using SqlHelper then I don't think you need Enterprise Library. Compared with Sqlhelper, the Enterprise Library Data Application Block provides an additional abstraction which makes codes database agnostic.

New Post: Bring Back SQLHelper Class

$
0
0
Yes I figured that out. I actually ported the SQLHelper class from the Application Block into one of my classes and everything works.

I know the code is from 2001 but it isn't like milk, if it works it saves me refactoring dozen of projects than I am ok with that.

Thanks for your answer I had already come to that conclusion this morning.

New Post: Enterprise Library Edit button dosen't show in vs2012

$
0
0
Hi, I need help
I've installed Enterprise Library 5.0 and update 0.1 both eatch time.
I've installed nuget on my VS2012 too.
after injecting EnLib DataAccess to Refrences in VS through the Manage Nuget Packages panel online, It'll add needed assemblies but the problem is when I add new ".config" file it dosen't show the orange Edit configuration File item when I right click on it!
I've watched the pluralsight tutorial movie of EnLib, and did all things like that, I have EnLib configuration panel in my All programs but I can't have it through the right click panel in vs2012.
mmmm, VS run as Administrator for sure .
EnLib.xsd also dosn't show in xmlschemas panel :(

New Post: Cannot start the Semantic Logging service for out-of-proc

$
0
0
I used the following command in the “Package Manager Console” window to download the below mentioned packages
• install-package EnterpriseLibrary.SemanticLogging
• install-package EnterpriseLibrary.SemanticLogging.Service
• install-package EnterpriseLibrary.SemanticLogging.TextFile

Once the packages were installed, from the "packages\EnterpriseLibrary.SemanticLogging.Service.2.0.1406.1\tools” folder i extracted the install-packages.ps1 file using the following command
"powershell –file .\install-packages.ps1"

All the assemblies are now extracted into the directory.

Now i try to start the service using the "SemanticLogging-svc.exe –s –a=LocalSystem" but the service did not start.

Please help me out in this issue as i had followed the same procedure on a couple of other machines and the service started and i could log using semantic logging block out-of-proc. I have got the powershell version 4 installed on my machine.

New Post: log file has guids for filename

$
0
0
Hi,

I have a web site that processes incoming XML messages (hundreds/second). It records about 8 log messages for each message received. I needed to use the rolling flat file listener because of the high volume of tracing (we always get disputes about the quality of the XML messages from those from whom we receive them and need some short-term record of what we received). The rolling flat file mechanism would be perfect, except for all the files with GUIDs in their names. They would be generated so quickly, there would be so many of them, and they would not be involved in any "rolling file rotation", they would fill up the hard drive in no time.

As I looked harder at the log messages that made it into the "TraceFile.LOG" series and those that didn't, I noticed that what started the unwanted behavior was a trace that hadn't been categorized. So, I went back and gave every trace message a category and - no more file names with GUIDs in them!

May sound strange, but try giving every message a category - don't assume a default.

Thanks,
Rob

New Post: Listener for System Center Operation Manager 2012 R2

$
0
0
Hi,

I would like to use the EL 6.0 Logging block to send performance information and alerts to SCOM 2012 R2, I understand that there used to be a WMI listener - any recommendations on how to accomplish this with 6.0?

Thanks,
Rob Hutchison

New Post: Rolling Log Listener stops logging whenever its companion Database Trace Listener starts to fail

$
0
0
Hi,

I was having the same issues as you were when I started playing around with sync vs. async and the async parameters. On my particular machine, the problem appeared to go away when I went to async, but only if I didn't constrain processors and if I gave it a generous buffer size. Right now, I am using:
asynchronous="true"
asynchronousBufferSize="800000"
asynchronousDegreeOfParallelism="8"
and that issue went away. When I tried "0" for DoP (this often means, use all processors), it didn't work at all.

Hope this helps,
Rob

New Post: Almost there, help

$
0
0
I have everything coded up and the SemanticLogging-svc.exe is running as a console app. I can see my events firing in the console window but none of the sinks are writing anything. I am trying a database sink and a rolling flat file. The flat file is being created but no messages are being written. I have the database and table setup from the provided sql scripts but no records have been created.

The event source names match with my class.

What could I be missing?

New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging

$
0
0
Is this expected behavior? We still haven't figured this out.
Viewing all 1928 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>