enterprise-library

Unity / EntLib: Injecting a dependency into a CustomTraceListener

徘徊边缘 提交于 2019-11-30 19:54:26
问题 Sorry, this is quite a special topic so this may not be of interest to many. :-( However, I need to do the following thing: I have an application that provides logging to some kind of console window (it's a WPF window, because of application requirements and because the application needs to look flashy even here - our special customer asked for that and talks about it every time we meet) To provide thread - agnostic logging I created an interface / implementation pair "IGUIController" /

Activation error occured while trying to get instance of type LogWriter, key “”?

风格不统一 提交于 2019-11-30 18:19:14
I have asp.net web site. I added reference of Microsoft.Practices.EnterpriseLibrary.Logging.dll to the site. in web.cofig file, I defined like below. <?xml version="1.0" encoding="utf-8" ?> <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" /> </configSections> <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory=

Upgrade to Enterprise Library 6.0 giving issues with 'EnterpriseLibraryContainer'

老子叫甜甜 提交于 2019-11-30 17:51:31
问题 After upgrading to Enterprise Library 6.0 I'm having the following problem: private static IUnityContainer container = EnterpriseLibraryContainer.Current.GetInstance(); Cannot resolve EnterpriseLibraryContainer I found another post that speaks about the EnterpriseLibraryCOntainer on stackoverflow In the upgrade notes of Enterprise Library it states: “The name ‘EnterpriseLibraryContainer’ does not exist in the current context The bootstrapping code for all of the blocks has changed in version

Enterprise Library 5.0 - Application Logging - Incorrect DateTime

元气小坏坏 提交于 2019-11-30 17:24:11
I am using Microsoft Enterprise library 5.0 for application logging of my .net application. Logging is working properly. But the problem is the DateTime that is being logged along with the logging message is incorrect. There is a time difference of 6.5 hrs. How can i correct this? Change your text formatter (in app.config) to use the local server time, otherwise it defaults to UTC. e.g. change {timestamp} token to {timestamp(local)} Nitin Changing in the config file will just reflect in the extended properties, the "TimeStamp" field will still show the time in UTC format. To Change it at both

Enterprise Library: Logging Block and Email

瘦欲@ 提交于 2019-11-30 15:21:25
问题 Does anyone have a tutorial link or an example on how to use the Logging block to send out error email? Jack 回答1: You need to set up an EmailTraceListener in the Logging Application Block. You can use the Enterprise Library UI but the web.config section ends up looking something like this: <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="Default" logWarningsWhenNoCategoriesMatch="true"> <listeners> <add toAddress="admin@company.com" fromAddress=

Enterprise Library: Logging Block and Email

自作多情 提交于 2019-11-30 13:58:24
Does anyone have a tutorial link or an example on how to use the Logging block to send out error email? Jack You need to set up an EmailTraceListener in the Logging Application Block. You can use the Enterprise Library UI but the web.config section ends up looking something like this: <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="Default" logWarningsWhenNoCategoriesMatch="true"> <listeners> <add toAddress="admin@company.com" fromAddress="fromemail@company.com" subjectLineStarter="" subjectLineEnder="" smtpServer="127.0.0.1" smtpPort="25"

Change Timestamp value in enterprise library exception handling formatter

安稳与你 提交于 2019-11-30 09:22:12
问题 I am using enterprize library 5.0 with c# for exception handling and for that I am using formatter.Now In my log file Timestamp is not giving the right time. Can I change the value of timestamp in formatter. 回答1: Timestamp: {timestamp(local)} will get the local system time 回答2: The timestamp entry uses UTC so that exceptions logged in different timezones can be correlated. The best idea is to convert the time to local if and when you read the trace log file and present the information to the

How To Use Exception Manager Enterprise Library 6.0

人走茶凉 提交于 2019-11-30 03:59:51
When using Enterprise Library 6.0, this error occurs in the code below: bool rethrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy1") "Must set an ExceptionManager in the ExceptionPolicy class using the SetExceptionManager method." In Enterprise Library 5.0 this code worked: public static bool HandleException(Exception exception, string PolicyName) { ExceptionManager exManager = EnterpriseLibraryContainer.Current.GetInstance<ExceptionManager>(); ExceptionPolicy.SetExceptionManager(exManager); bool rethrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy1"); return reThrow; } But in

Activation error occured while trying to get instance of type ICacheManager, key “Cache Manager”

限于喜欢 提交于 2019-11-30 03:47:38
问题 I seem to have hit a wall here and would appreciate some help from anyone who is able to on this one. I am not exactly sure what the error message below means. I am using the Caching Block of Enterprise Pattern Services but I keep running in to the problem below. I downloaded the latest version and tried stepping through to the issue but I can't seem to pin the exact problem and I need help please. Thanks in advance Test method WorldBank.Service.Business.UnitTest.TopicsManagerTest.Call

Activation error occured while trying to get instance of type LogWriter, key “”?

别来无恙 提交于 2019-11-30 01:57:22
问题 I have asp.net web site. I added reference of Microsoft.Practices.EnterpriseLibrary.Logging.dll to the site. in web.cofig file, I defined like below. <?xml version="1.0" encoding="utf-8" ?> <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" /> <