Optimized logging to improve performance

This commit is contained in:
kay.one 2011-05-19 19:13:21 -07:00
parent 69406a95d4
commit 9cad9bbbd7
3 changed files with 4 additions and 3 deletions

View File

@ -75,7 +75,7 @@ namespace NzbDrone.Core
var logRepository = new SimpleRepository(logDbProvider, SimpleRepositoryOptions.RunMigrations);
//dbProvider.ExecuteQuery(new QueryCommand("VACUUM", dbProvider));
dbProvider.Log = new NlogWriter();
//dbProvider.Log = new NlogWriter();
_kernel.Bind<QualityProvider>().ToSelf().InSingletonScope();
_kernel.Bind<TvDbProvider>().ToSelf().InTransientScope();

View File

@ -108,6 +108,7 @@ namespace NzbDrone.Core.Providers
public virtual Series FindSeries(string title)
{
//TODO:Add series alias support here. if a series is not found in the repo should be tried using its aliases
var normalizeTitle = Parser.NormalizeTitle(title);
return _repository.Single<Series>(s => s.CleanTitle == normalizeTitle);
}

View File

@ -9,10 +9,10 @@
<parameter name="ThreadName" layout="${threadname}" xsi:type="NLogViewerParameterInfo" />
</target>
<target name="file" xsi:type="File"
<target name="file" xsi:type="File" keepFileOpen="true" openFileCacheTimeout="1"
layout="${longdate} [${level}] ${logger}: ${message} ${exception:ToString}"
fileName="${basedir}/App_Data/logs/${shortdate}.txt" />
<target name ="xmlFile" xsi:type="File"
<target name ="xmlFile" xsi:type="File" keepFileOpen="true" openFileCacheTimeout="1"
fileName="${basedir}/App_Data/logs/${shortdate}.xml"
layout="${log4jxmlevent:includeSourceInfo=true:includeCallSite=true:includeMDC=true:appInfo=true:includeNDC=true:includeNLogData=true}"/>
</targets>