diff --git a/src/OneScript/Infrastructure/AppStarter.cs b/src/OneScript/Infrastructure/AppStarter.cs index 7292774..b9f628a 100644 --- a/src/OneScript/Infrastructure/AppStarter.cs +++ b/src/OneScript/Infrastructure/AppStarter.cs @@ -30,6 +30,8 @@ public AppStarter(IFileProvider scripts, IApplicationRuntime webEng, IConfigurat _scripts = scripts; _webEng = webEng; _logger = appLog; + + SystemLogger.SetWriter(new StandardLogSystemLogWriter(_logger)); var configSection = config?.GetSection("OneScript"); var libRoot = configSection?["lib.system"]; diff --git a/src/OneScript/Infrastructure/StandardLogSystemLogWriter.cs b/src/OneScript/Infrastructure/StandardLogSystemLogWriter.cs new file mode 100644 index 0000000..c364cf2 --- /dev/null +++ b/src/OneScript/Infrastructure/StandardLogSystemLogWriter.cs @@ -0,0 +1,21 @@ + +using Microsoft.Extensions.Logging; +using ScriptEngine; + +namespace OneScript.WebHost.Infrastructure +{ + class StandardLogSystemLogWriter : ISystemLogWriter + { + private readonly ILogger _logger; + + public StandardLogSystemLogWriter(ILogger logger) + { + _logger = logger; + } + + public void Write(string text) + { + _logger.LogInformation(text); + } + } +} \ No newline at end of file