Switch to using MS logging abstractions (#267)
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Apache.NMS" Version="2.0.0" />
|
||||
<PackageVersion Include="Apache.NMS.ActiveMQ" Version="1.7.2" />
|
||||
<PackageVersion Include="Common.Logging" Version="3.4.1" />
|
||||
<PackageVersion Include="Common.Logging.Log4Net1213" Version="3.4.1" />
|
||||
<PackageVersion Include="Common.Logging.Log4Net1215" Version="3.4.1" />
|
||||
<PackageVersion Include="log4net" Version="3.0.4" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="8.0.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
|
||||
<PackageVersion Include="NUnit" Version="3.14.0" />
|
||||
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
|
||||
@@ -5,7 +5,6 @@ MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B1FF7E1F-9BF9-4EB3-B38C-39A0E3EA4D0A}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
readme.txt = readme.txt
|
||||
SpringCalculator.snk = SpringCalculator.snk
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.Services.2010", "src\Spring.Calculator.Services\Spring.Calculator.Services.csproj", "{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright © 2002-2011 the original author or authors.
|
||||
*
|
||||
* Copyright <EFBFBD> 2002-2011 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -23,7 +23,7 @@
|
||||
using System;
|
||||
|
||||
using AopAlliance.Intercept;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -37,13 +37,13 @@ namespace Spring.Aspects.Logging
|
||||
{
|
||||
#region Logging
|
||||
|
||||
private static readonly ILog LOG = LogManager.GetLogger(typeof(CommonLoggingAroundAdvice));
|
||||
private static readonly ILogger LOG = LogManager.GetLogger(typeof(CommonLoggingAroundAdvice));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
private LogLevel _level = LogLevel.All;
|
||||
private LogLevel _level = LogLevel.Trace;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Spring.Aspects.Logging
|
||||
|
||||
public LogLevel Level
|
||||
{
|
||||
get { return _level; }
|
||||
get { return _level; }
|
||||
set { _level = value; }
|
||||
}
|
||||
|
||||
@@ -75,23 +75,23 @@ namespace Spring.Aspects.Logging
|
||||
{
|
||||
switch(Level)
|
||||
{
|
||||
case LogLevel.All :
|
||||
case LogLevel.Trace :
|
||||
case LogLevel.Debug :
|
||||
if (LOG.IsDebugEnabled) LOG.Debug(String.Format(text, args));
|
||||
if (LOG.IsEnabled(LogLevel.Debug)) LOG.LogDebug(String.Format(text, args));
|
||||
break;
|
||||
case LogLevel.Error :
|
||||
if (LOG.IsErrorEnabled) LOG.Error(String.Format(text, args));
|
||||
if (LOG.IsEnabled(LogLevel.Error)) LOG.LogError(String.Format(text, args));
|
||||
break;
|
||||
case LogLevel.Fatal :
|
||||
if (LOG.IsFatalEnabled) LOG.Fatal(String.Format(text, args));
|
||||
case LogLevel.Critical :
|
||||
if (LOG.IsEnabled(LogLevel.Critical)) LOG.LogCritical(String.Format(text, args));
|
||||
break;
|
||||
case LogLevel.Info :
|
||||
if (LOG.IsInfoEnabled) LOG.Info(String.Format(text, args));
|
||||
case LogLevel.Information :
|
||||
if (LOG.IsEnabled(LogLevel.Information)) LOG.LogInformation(String.Format(text, args));
|
||||
break;
|
||||
case LogLevel.Warn :
|
||||
if (LOG.IsWarnEnabled) LOG.Warn(String.Format(text, args));
|
||||
case LogLevel.Warning:
|
||||
if (LOG.IsEnabled(LogLevel.Warning)) LOG.LogWarning(String.Format(text, args));
|
||||
break;
|
||||
case LogLevel.Off:
|
||||
case LogLevel.None:
|
||||
default :
|
||||
break;
|
||||
}
|
||||
@@ -99,4 +99,4 @@ namespace Spring.Aspects.Logging
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -45,15 +45,6 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Common.Logging">
|
||||
<HintPath>..\..\..\..\..\lib\Net\2.0\Common.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging.Log4Net1211">
|
||||
<HintPath>..\..\..\..\..\lib\Net\2.0\Common.Logging.Log4Net1211.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\..\..\..\..\lib\Net\4.0\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Aop">
|
||||
<HintPath>..\..\..\..\..\bin\net\4.0\debug\Spring.Aop.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<ProjectReference Include="..\Primes\Primes.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
<Reference Include="System.Configuration" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -20,10 +20,7 @@
|
||||
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
|
||||
using Common.Logging;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Northwind.Domain;
|
||||
|
||||
#endregion
|
||||
@@ -32,11 +29,11 @@ namespace Spring.Northwind.Service
|
||||
{
|
||||
public class FedExShippingService : IShippingService
|
||||
{
|
||||
protected static readonly ILog log = LogManager.GetLogger(typeof (FedExShippingService));
|
||||
protected static readonly ILogger log = LogManager.GetLogger(typeof (FedExShippingService));
|
||||
|
||||
public void ShipOrder(Order order)
|
||||
{
|
||||
log.Info("Shipping order id = " + order.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
using Common.Logging;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Transaction.Interceptor;
|
||||
|
||||
using Spring.Northwind.Dao;
|
||||
@@ -38,7 +36,7 @@ namespace Spring.Northwind.Service
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof (FulfillmentService));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof (FulfillmentService));
|
||||
|
||||
private IProductDao productDao;
|
||||
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using log4net.Appender;
|
||||
using log4net.Core;
|
||||
using log4net.Layout;
|
||||
using log4net.Repository;
|
||||
|
||||
using Spring.Northwind.Service;
|
||||
using Spring.Web.UI;
|
||||
|
||||
using LogManager=log4net.LogManager;
|
||||
|
||||
public partial class FullfillmentResult : ConversationPage
|
||||
{
|
||||
@@ -28,36 +18,8 @@ public partial class FullfillmentResult : ConversationPage
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// gather log4net output with small hack to get results...
|
||||
ILoggerRepository repository = LogManager.GetRepository();
|
||||
IAppender[] appenders = repository.GetAppenders();
|
||||
MemoryAppender appender = null;
|
||||
foreach (IAppender a in appenders)
|
||||
{
|
||||
if (a is MemoryAppender)
|
||||
{
|
||||
// we found our appender to look results from
|
||||
appender = a as MemoryAppender;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (appender != null)
|
||||
{
|
||||
appender.Clear();
|
||||
fulfillmentService.ProcessCustomer(customerEditController.CurrentCustomer.Id);
|
||||
LoggingEvent[] events = appender.GetEvents();
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
PatternLayout layout = new PatternLayout("%date{HH:mm:ss} %-5level %logger{1}: %message<br />");
|
||||
foreach (LoggingEvent loggingEvent in events)
|
||||
{
|
||||
layout.Format(stringWriter, loggingEvent);
|
||||
}
|
||||
|
||||
results.Text = stringWriter.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void customerOrders_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetResult("Back");
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging.Log4Net1213" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using log4net.Appender;
|
||||
using log4net.Core;
|
||||
using log4net.Layout;
|
||||
using log4net.Repository;
|
||||
|
||||
using Spring.Northwind.Service;
|
||||
using Spring.Web.UI;
|
||||
|
||||
using LogManager=log4net.LogManager;
|
||||
|
||||
public partial class FullfillmentResult : Page
|
||||
{
|
||||
private IFulfillmentService fulfillmentService;
|
||||
@@ -28,36 +20,8 @@ public partial class FullfillmentResult : Page
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// gather log4net output with small hack to get results...
|
||||
ILoggerRepository repository = LogManager.GetRepository();
|
||||
IAppender[] appenders = repository.GetAppenders();
|
||||
MemoryAppender appender = null;
|
||||
foreach (IAppender a in appenders)
|
||||
{
|
||||
if (a is MemoryAppender)
|
||||
{
|
||||
// we found our appender to look results from
|
||||
appender = a as MemoryAppender;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (appender != null)
|
||||
{
|
||||
appender.Clear();
|
||||
fulfillmentService.ProcessCustomer(customerEditController.CurrentCustomer.Id);
|
||||
LoggingEvent[] events = appender.GetEvents();
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
PatternLayout layout = new PatternLayout("%date{HH:mm:ss} %-5level %logger{1}: %message<br />");
|
||||
foreach (LoggingEvent loggingEvent in events)
|
||||
{
|
||||
layout.Format(stringWriter, loggingEvent);
|
||||
}
|
||||
|
||||
results.Text = stringWriter.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void customerOrders_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetResult("Back");
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging.Log4Net1213" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<RootNamespace>Spring</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Spring.Core">
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
<configuration>
|
||||
|
||||
<configSections>
|
||||
<sectionGroup name="common">
|
||||
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="spring">
|
||||
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
|
||||
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
|
||||
@@ -12,17 +9,6 @@
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
|
||||
<common>
|
||||
<logging>
|
||||
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net1215">
|
||||
<!-- choices are INLINE, FILE, FILE-WATCH, EXTERNAL-->
|
||||
<!-- otherwise BasicConfigurer.Configure is used -->
|
||||
<!-- log4net configuration file is specified with key configFile-->
|
||||
<arg key="configType" value="INLINE" />
|
||||
</factoryAdapter>
|
||||
</logging>
|
||||
</common>
|
||||
|
||||
<spring>
|
||||
|
||||
<context>
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
using Common.Logging;
|
||||
using Common.Logging.Log4Net;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Context;
|
||||
using Spring.Context.Support;
|
||||
using Spring.Objects.Factory.Config;
|
||||
@@ -46,7 +45,7 @@ namespace Spring.IocQuickStart.MovieFinder
|
||||
{
|
||||
#region Logging Definition
|
||||
|
||||
private static readonly ILog LOG = LogManager.GetLogger(typeof(Program));
|
||||
private static readonly ILogger LOG = LogManager.GetLogger(typeof(Program));
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -94,7 +93,7 @@ namespace Spring.IocQuickStart.MovieFinder
|
||||
|
||||
private static IApplicationContext CreateContextProgrammatically()
|
||||
{
|
||||
InitializeCommonLogging();
|
||||
InitializeLogging();
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
|
||||
IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory();
|
||||
@@ -119,7 +118,7 @@ namespace Spring.IocQuickStart.MovieFinder
|
||||
|
||||
private static IApplicationContext CreateContextProgrammaticallyWithAutoWire()
|
||||
{
|
||||
InitializeCommonLogging();
|
||||
InitializeLogging();
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
|
||||
IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory();
|
||||
@@ -165,14 +164,15 @@ namespace Spring.IocQuickStart.MovieFinder
|
||||
return ctx;
|
||||
}
|
||||
|
||||
private static void InitializeCommonLogging()
|
||||
private static void InitializeLogging()
|
||||
{
|
||||
var properties = new Common.Logging.Configuration.NameValueCollection();
|
||||
properties["configType"] = "INLINE";
|
||||
LogManager.Adapter = new Log4NetLoggerFactoryAdapter(properties);
|
||||
var loggerFactory = LoggerFactory.Create(
|
||||
builder => builder.AddLog4Net());
|
||||
|
||||
LogManager.LoggerFactory = loggerFactory;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<EmbeddedResource Include="MovieFinder\*.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Common.Logging.Log4Net1215" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="movies.txt">
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
|
||||
</sectionGroup>
|
||||
|
||||
<sectionGroup name="common">
|
||||
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
|
||||
</sectionGroup>
|
||||
|
||||
</configSections>
|
||||
|
||||
<spring>
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
|
||||
|
||||
using System.Collections;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.MsmqQuickStart.Client.UI;
|
||||
using Spring.MsmqQuickStart.Common.Data;
|
||||
|
||||
@@ -11,7 +8,7 @@ namespace Spring.MsmqQuickStart.Client.Handlers
|
||||
{
|
||||
#region Logging Definition
|
||||
|
||||
private readonly ILog log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
private readonly ILogger log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -45,4 +42,4 @@ namespace Spring.MsmqQuickStart.Client.Handlers
|
||||
log.Error("could not handle object of type = " + catchAllObject.GetType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Context;
|
||||
using Spring.Context.Support;
|
||||
using Spring.MsmqQuickStart.Client.UI;
|
||||
@@ -12,7 +12,7 @@ namespace Spring.MsmqQuickStart.Client
|
||||
static class Program
|
||||
{
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Program));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof(Program));
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
@@ -44,4 +44,4 @@ namespace Spring.MsmqQuickStart.Client
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@
|
||||
<Content Include="Config\*.xml" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Context.Support;
|
||||
using Spring.MsmqQuickStart.Common.Data;
|
||||
|
||||
@@ -11,7 +10,7 @@ namespace Spring.MsmqQuickStart.Client.UI
|
||||
{
|
||||
#region Logging Definition
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof (StockForm));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof (StockForm));
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -58,4 +57,4 @@ namespace Spring.MsmqQuickStart.Client.UI
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
|
||||
</sectionGroup>
|
||||
|
||||
<sectionGroup name="common">
|
||||
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
|
||||
</sectionGroup>
|
||||
|
||||
</configSections>
|
||||
|
||||
<spring>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Messaging.Core;
|
||||
|
||||
|
||||
@@ -9,7 +8,7 @@ namespace Spring.MsmqQuickStart.Server.Gateways
|
||||
{
|
||||
public class MarketDataServiceGateway : MessageQueueGatewaySupport, IMarketDataService
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof (MarketDataServiceGateway));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof (MarketDataServiceGateway));
|
||||
|
||||
private readonly Random random;
|
||||
private TimeSpan sleepTimeInSeconds = new TimeSpan(0,0,0,10,0);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.MsmqQuickStart.Common.Data;
|
||||
using Spring.MsmqQuickStart.Server.Services;
|
||||
using Spring.Util;
|
||||
@@ -11,7 +11,7 @@ namespace Spring.MsmqQuickStart.Server.Handlers
|
||||
{
|
||||
public class StockAppHandler
|
||||
{
|
||||
private readonly ILog log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
private readonly ILogger log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
|
||||
private readonly IExecutionVenueService executionVenueService;
|
||||
private readonly ICreditCheckService creditCheckService;
|
||||
@@ -46,4 +46,4 @@ namespace Spring.MsmqQuickStart.Server.Handlers
|
||||
return tradeResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
<Content Include="Config\*.xml" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,25 +1,25 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Collections;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.NmsQuickStart.Client.UI;
|
||||
using Spring.NmsQuickStart.Common.Data;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Spring.NmsQuickStart.Client.Handlers
|
||||
{
|
||||
#region Logging Definition
|
||||
|
||||
private readonly ILog log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
private readonly ILogger log = LogManager.GetLogger(typeof(StockAppHandler));
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -63,4 +63,4 @@ namespace Spring.NmsQuickStart.Client.Handlers
|
||||
log.Error("could not handle object of type = " + catchAllObject.GetType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
@@ -21,7 +21,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Context;
|
||||
using Spring.Context.Support;
|
||||
using Spring.NmsQuickStart.Client.UI;
|
||||
@@ -31,7 +31,7 @@ namespace Spring.NmsQuickStart.Client
|
||||
static class Program
|
||||
{
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Program));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof(Program));
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
@@ -41,7 +41,7 @@ namespace Spring.NmsQuickStart.Client
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Info("Running....");
|
||||
log.LogInformation("Running....");
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
using (IApplicationContext ctx = ContextRegistry.GetContext())
|
||||
@@ -53,14 +53,14 @@ namespace Spring.NmsQuickStart.Client
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error("Spring.NmsQuickStart.Client is broken.", e);
|
||||
log.LogError("Spring.NmsQuickStart.Client is broken.", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
log.Error("Uncaught application exception.", e.Exception);
|
||||
log.LogError(e.Exception, "Uncaught application exception.");
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<ProjectReference Include="..\Spring.NmsQuickStart.Common\Spring.NmsQuickStart.Common.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Spring.Core">
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
@@ -21,7 +21,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Context.Support;
|
||||
using Spring.NmsQuickStart.Common.Data;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Spring.NmsQuickStart.Client.UI
|
||||
{
|
||||
#region Logging Definition
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof (StockForm));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof (StockForm));
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -83,4 +83,4 @@ namespace Spring.NmsQuickStart.Client.UI
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Messaging.Nms.Core;
|
||||
|
||||
namespace Spring.NmsQuickStart.Server.Gateways
|
||||
{
|
||||
public class MarketDataServiceGateway : NmsGatewaySupport, IMarketDataService
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof (MarketDataServiceGateway));
|
||||
private static readonly ILogger log = LogManager.GetLogger(typeof (MarketDataServiceGateway));
|
||||
|
||||
private readonly Random random;
|
||||
private TimeSpan sleepTimeInSeconds = new TimeSpan(0,0,0,10,0);
|
||||
@@ -62,4 +62,4 @@ namespace Spring.NmsQuickStart.Server.Gateways
|
||||
//y2 = x2 * w;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
using System;
|
||||
using Common.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spring.Messaging.Nms.Core;
|
||||
|
||||
namespace Spring.NmsQuickStart.Server.Handlers
|
||||
@@ -10,7 +10,7 @@ namespace Spring.NmsQuickStart.Server.Handlers
|
||||
{
|
||||
#region Logging
|
||||
|
||||
private readonly ILog logger = LogManager.GetLogger(typeof(LoggingExceptionListener));
|
||||
private readonly ILogger logger = LogManager.GetLogger(typeof(LoggingExceptionListener));
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Spring.NmsQuickStart.Server.Handlers
|
||||
/// <param name="exception">The exception.</param>
|
||||
public void OnException(Exception exception)
|
||||
{
|
||||
logger.Info("********* Caught exception *************", exception);
|
||||
logger.LogInformation(exception, "********* Caught exception *************");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ProjectReference Include="..\Spring.NmsQuickStart.Common\Spring.NmsQuickStart.Common.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Spring.Core">
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="spring-objects.xml" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\src\Spring\Spring.Scheduling.Quartz3\Spring.Scheduling.Quartz3.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<EmbeddedResource Include="TxQuickStart\*.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Common.Logging.Log4Net1215" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="NUnit" />
|
||||
<PackageReference Include="NUnit3TestAdapter" />
|
||||
|
||||
Reference in New Issue
Block a user