It seems it does not and we are planning to use it (Logging, Exception, etc..) for future projects. Is it still supported? I do not see a lot of activity around this tool as there used to be.
We already have NewRelic so also be helpful to know if NewRelic can do logging/Exception handling already. For example, can I create custom logs or exceptions and see them in the new relic dashboard?
It does. You may add Enterprise Library 6 into your project via Nuget Here is the sample application.
using System;
using System.Diagnostics;
using Microsoft.Practices.EnterpriseLibrary.Logging;
using Microsoft.Practices.EnterpriseLibrary.Logging.Formatters;
using Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners;
namespace Practice.Logging
{
internal class Program
{
public static void Main(string[] args)
{
LoggingConfiguration loggingConfiguration = BuildProgrammaticConfig();
var defaultWriter = new LogWriter(loggingConfiguration);
// Check if logging is enabled before creating log entries.
if (defaultWriter.IsLoggingEnabled())
{
defaultWriter.Write("Log entry created using the simplest overload.");
defaultWriter.Write("Log entry with a single category.", "General");
defaultWriter.Write("Log entry with a category, priority, and event ID.", "General", 6, 9001);
defaultWriter.Write("Log entry with a category, priority, event ID, " + "and severity.", "General", 5, 9002, TraceEventType.Warning);
defaultWriter.Write("Log entry with a category, priority, event ID, " + "severity, and title.", "General", 8, 9003, TraceEventType.Warning, "Logging Block Examples");
}
else
{
Console.WriteLine("Logging is disabled in the configuration.");
}
}
private static LoggingConfiguration BuildProgrammaticConfig()
{
// Formatter
var formatter = new TextFormatter();
// Trace Listeners
var eventLog = new EventLog("Application", ".", "StackOverflow #24309323");
var eventLogTraceListener = new FormattedEventLogTraceListener(eventLog, formatter);
// Build Configuration
var config = new LoggingConfiguration();
config.AddLogSource("General", SourceLevels.All, true)
.AddTraceListener(eventLogTraceListener);
config.IsTracingEnabled = true;
return config;
}
}
}
You may find more details in Logging Application Block
To install the extension into the Visual Studio 2013 you may follow the workaround steps below.
A VSIX file is a zip file that uses the Open Packaging Convention. You can rename the .VSIX extension to .ZIP and use any zip browser (including the Windows File Explorer) to browse its contents.
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>Ultimate</Edition>
<Edition>Premium</Edition>
<Edition>Pro</Edition>
</VisualStudio>
</SupportedProducts>
<SupportedProducts>
<VisualStudio Version="11.0">
<Edition>Ultimate</Edition>
<Edition>Premium</Edition>
<Edition>Pro</Edition>
</VisualStudio>
<VisualStudio Version="12.0"> <!-- VS2013 -->
<Edition>Ultimate</Edition>
<Edition>Premium</Edition>
<Edition>Pro</Edition>
</VisualStudio>
<VisualStudio Version="14.0"> <!-- VS2015 -->
<Edition>Ultimate</Edition>
<Edition>Premium</Edition>
<Edition>Pro</Edition>
</VisualStudio>
</SupportedProducts>
ZIP
file againVSIX
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With