Optimized logging to improve performance

pull/3113/head
kay.one 14 years ago
parent 69406a95d4
commit 9cad9bbbd7

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

@ -108,6 +108,7 @@ namespace NzbDrone.Core.Providers
public virtual Series FindSeries(string title) 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); var normalizeTitle = Parser.NormalizeTitle(title);
return _repository.Single<Series>(s => s.CleanTitle == normalizeTitle); return _repository.Single<Series>(s => s.CleanTitle == normalizeTitle);
} }

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

Loading…
Cancel
Save