mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
moved log to object db.
This commit is contained in:
parent
71dcd623f7
commit
b3c6db5997
21 changed files with 157 additions and 321 deletions
|
@ -2,23 +2,20 @@
|
|||
using NLog.Config;
|
||||
using NLog;
|
||||
using NLog.Targets;
|
||||
using NLog.Targets.Wrappers;
|
||||
using NzbDrone.Common;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
|
||||
public class DatabaseTarget : Target
|
||||
{
|
||||
private readonly IDatabase _database;
|
||||
private readonly ILogRepository _repository;
|
||||
|
||||
public DatabaseTarget(IDatabase database)
|
||||
public DatabaseTarget(ILogRepository repository)
|
||||
{
|
||||
_database = database;
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
|
||||
public void Register()
|
||||
{
|
||||
LogManager.Configuration.AddTarget("DbLogger", this);
|
||||
|
@ -62,7 +59,7 @@ namespace NzbDrone.Core.Instrumentation
|
|||
|
||||
log.Level = logEvent.Level.Name;
|
||||
|
||||
_database.Insert(log);
|
||||
_repository.Insert(log);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue