Friday, February 15, 2008

Exception Handling & Logging Application Block: Enterprise Library

I got a chance to work on POC on Logging and Exception handling using Enterprise Library method,... It was cool stuff ....

After so many R&D ,...I am able to configure the config to specify log file path and other stuff for Exception and log

below is the sample web.config which says the methods how we can configure








defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">

header="---------------------------------------- DBLayerException Log"
footer="---------------------------------------- Copy Right : DBLayer2008"
formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="DateTime" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="StarMark Exception FlatFile TraceListener" />
header="---------------------------------------- Country List Logger"
footer="----------------------------------------Copy Right DBLayer"
formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="DateTime" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Starmark FlatFile TraceListener" />
log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Formatted EventLog TraceListener" />
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.XmlTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.XmlTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Starmark XML Trace Listener" />


type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Text Formatter" />





































postHandlingAction="NotifyRethrow" name="Exception">

severity="Error" title="Enterprise Library Starmark Exception Handling"
formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Starmark Exception Log Handler" />







providerName="System.Data.SqlClient" />












Check this links
http://www.codeproject.com/KB/architecture/GetLoggingWithEntLib.aspx
http://www.codeproject.com/KB/aspnet/ExceptionHandling.aspx
for more details.........

Kodachadri Trip

After so many R&D , As per the Plan we statrted our Kodachadri trip fom Bangalore on Friday 4th January night and reached Shimoga in the morning about 5.30 in Shimoga passanger train.
booked a room in shimoga for 1hr and finished all morning work,and early morning i somehow managed to get a small bottel..since everybody is telling we wont get anything there in kodachadri

From shimoga, we took a private bus to Hosa nagara, around 12.30 the bus people dropped at the place Kareghatta where mud road start..
And our trecking started from there,
everybody started with full energy and josh. On the way we had lunch chapathi,fruits .
After 3 hour journey everybody was so tiered and some how managed to reach till Kaka's hotel and had lime juice.

We enquired about availability of jeep from there and got to know that, no way of getting jeep from that place, we have to walk till the top.

Everybody started scolding sandeep,...again our trecking started,..as we go to the top, everybody was so tiered that we used to take rest for about 10 mins walk. later we reduced our luggage by finishing the food items.

The condition of some people in the group has become worst,we thougt we should carry dilip to top,as he was fully gone.
but somehow he managed to come. we got a samll hotel at the top from where we can see Bhats house, we again had lime juice and started the journey.
the scenary was too good, but we are not in a condition to enjoy the nature at that time.

When we are walking we saw some local people from shimoga surrounding, who are walking easily there with out any struggle.

At last we reached the top around 6.30 pm , as soon as we go there one person asked us about staying in his house,but we already decided to stay in bhats house.

Sandeep has somehow managed to collect bhats son mobile no. who is working in bangalore as system admin, and he is a classmate of our Praveen kulakarni.

So, with this link we approached to bhats house and we agreed to all there conditions. dropped all our luggage


To be continued..............