mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
// ==========================================================================
|
|
// SemanticLogLoggerProvider.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Squidex.Infrastructure.Log.Adapter
|
|
{
|
|
public class SemanticLogLoggerProvider : ILoggerProvider
|
|
{
|
|
private readonly ISemanticLog semanticLog;
|
|
|
|
public SemanticLogLoggerProvider(ISemanticLog semanticLog)
|
|
{
|
|
Guard.NotNull(semanticLog, nameof(semanticLog));
|
|
|
|
this.semanticLog = semanticLog;
|
|
}
|
|
|
|
public ILogger CreateLogger(string categoryName)
|
|
{
|
|
return new SemanticLogLogger(semanticLog.CreateScope(writer =>
|
|
{
|
|
writer.WriteProperty("category", categoryName);
|
|
}));
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|