Skip to content

Commit

Permalink
Using NLog to log messages to LogEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
trayburn committed Apr 3, 2012
1 parent c594d2b commit bf476eb
Show file tree
Hide file tree
Showing 40 changed files with 167,560 additions and 15,905 deletions.
2 changes: 1 addition & 1 deletion src/SWTOR.Web/IoC/LoggingInstaller.cs
Expand Up @@ -13,7 +13,7 @@ public class LoggingInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.AddFacility<LoggingFacility>(c => c.UseLog4Net().WithAppConfig());
container.AddFacility<LoggingFacility>(c => c.UseNLog().WithAppConfig());
container.Register(Component.For<ErrorLoggerAttribute>());
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/SWTOR.Web/SWTOR.Web.csproj
Expand Up @@ -46,8 +46,8 @@
<Reference Include="Castle.Facilities.Logging">
<HintPath>..\packages\Castle.LoggingFacility.3.0.0.4001\lib\net40\Castle.Facilities.Logging.dll</HintPath>
</Reference>
<Reference Include="Castle.Services.Logging.Log4netIntegration">
<HintPath>..\packages\Castle.Core-log4net.3.0.0.4003\lib\net40\Castle.Services.Logging.Log4netIntegration.dll</HintPath>
<Reference Include="Castle.Services.Logging.NLogIntegration">
<HintPath>..\packages\Castle.Core-NLog.3.0.0.4001\lib\net40-client\Castle.Services.Logging.NLogIntegration.dll</HintPath>
</Reference>
<Reference Include="Castle.Windsor">
<HintPath>..\packages\Castle.Windsor.3.0.0.4001\lib\net40\Castle.Windsor.dll</HintPath>
Expand All @@ -61,8 +61,12 @@
<Reference Include="ICSharpCode.NRefactory">
<HintPath>..\packages\RavenDB-Embedded.1.0.701\lib\net40\ICSharpCode.NRefactory.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.1.2.10\lib\2.0\log4net.dll</HintPath>
<Reference Include="le_nlog">
<HintPath>..\packages\le_nlog.1.5\lib\4.0\le_nlog.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\packages\RavenDB-Embedded.1.0.701\lib\net40\Lucene.Net.dll</HintPath>
Expand Down
15 changes: 0 additions & 15 deletions src/SWTOR.Web/Views/Web.config
Expand Up @@ -55,19 +55,4 @@
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<log4net>
<appender name="LeAppender" type="log4net.Appender.LeAppender, LeLog4net">
<Key value="4984da75-2b91-4001-b657-eed6b1b47c34" />
<Location value="AppHarbor/Default" />
<Debug value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern"
value="%d{ddd MMM dd HH:mm:ss zzz yyyy} %logger %: %level%, %m" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="LeAppender" />
</root>
</log4net>
</configuration>
13 changes: 12 additions & 1 deletion src/SWTOR.Web/Web.config
Expand Up @@ -7,7 +7,7 @@
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" />
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
Expand Down Expand Up @@ -61,4 +61,15 @@
<connectionStrings>
<add name="RavenDB" connectionString="Url=http://localhost:8080" />
</connectionStrings>
<nlog>
<extensions>
<add assembly="le_nlog" />
</extensions>
<targets>
<target name="logentries" type="Logentries" key="4984da75-2b91-4001-b657-eed6b1b47c34" location="AppHarbor/Default" debug="true" layout="${date:format=ddd MMM dd} ${time:format=HH:mm:ss} ${date:format=zzz yyyy} ${logger} : ${LEVEL}, ${message}, ${exception:format=tostring}" />
</targets>
<rules>
<logger name="*" minLevel="Debug" appendTo="logentries" />
</rules>
</nlog>
</configuration>
5 changes: 3 additions & 2 deletions src/SWTOR.Web/packages.config
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.0.0.4001" />
<package id="Castle.Core-log4net" version="3.0.0.4003" />
<package id="Castle.Core-NLog" version="3.0.0.4001" />
<package id="Castle.LoggingFacility" version="3.0.0.4001" />
<package id="Castle.Windsor" version="3.0.0.4001" />
<package id="EntityFramework" version="4.3.1" />
<package id="jQuery" version="1.7.1" />
<package id="jQuery.UI.Combined" version="1.8.18" />
<package id="jQuery.Validation" version="1.8.1" />
<package id="log4net" version="1.2.10" />
<package id="le_nlog" version="1.5" />
<package id="log4net" version="2.0.0" />
<package id="Modernizr" version="2.5.3" />
<package id="Newtonsoft.Json" version="4.0.8" />
<package id="NLog" version="2.0.0.2000" />
Expand Down
70 changes: 70 additions & 0 deletions src/packages/Castle.Core-NLog.3.0.0.4001/BreakingChanges.txt
@@ -0,0 +1,70 @@
================================================================================================
change - Removed overloads of logging methods that were taking format string from ILogger and
ILogger and IExtendedLogger and didn't have word Format in their name.
For example:
void Error(string format, params object[] args); // was removed
void ErrorFormat(string format, params object[] args); //use this one instead


impact - low
fixability - medium
revision -

description - To minimize confusion and duplication those methods were removed.

fix - Use methods that have explicit "Format" word in their name and same signature.
================================================================================================
change - Removed WebLogger and WebLoggerFactory

impact - low
fixability - medium
revision -

description - To minimize management overhead the classes were removed so that only single
Client Profile version of Castle.Core can be distributed.

fix - You can use NLog or Log4Net web logger integration, or reuse implementation of existing
web logger and use it as a custom logger.

================================================================================================
change - Removed obsolete overload of ProxyGenerator.CreateClassProxy

impact - low
fixability - trivial
revision -

description - Deprecated overload of ProxyGenerator.CreateClassProxy was removed to keep the
method consistent with other methods and to remove confusion

fix - whenever removed overload was used, use one of the other overloads.

================================================================================================
change - IProxyGenerationHook.NonVirtualMemberNotification method was renamed

impact - high
fixability - easy
revision -

description - to accommodate class proxies with target method NonVirtualMemberNotification on
IProxyGenerationHook type was renamed to more accurate NonProxyableMemberNotification
since for class proxies with target not just methods but also fields and other member that
break the abstraction will be passed to this method.

fix - whenever NonVirtualMemberNotification is used/implemented change the method name to
NonProxyableMemberNotification. Implementors should also accommodate possibility that not
only MethodInfos will be passed as method's second parameter.

================================================================================================
change - DynamicProxy will now allow to intercept members of System.Object

impact - very low
fixability - easy
revision -

description - to allow scenarios like mocking of System.Object members, DynamicProxy will not
disallow proxying of these methods anymore. AllMethodsHook (default IProxyGenerationHook)
will still filter them out though.

fix - whenever custom IProxyGenerationHook is used, user should account for System.Object's
members being now passed to ShouldInterceptMethod and NonVirtualMemberNotification methods
and if neccessary update the code to handle them appropriately.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit bf476eb

Please sign in to comment.