如何 运行 GELF 扩展记录器?

How to run GELF Extension logger?

我运行 NET Core 的示例: [https://github.com/mattwcole/gelf-extensions-logging/blob/dev/samples/Gelf.Extensions.Logging.Samples.NetCore2/Program.cs][1]

那我有运行Docker https://docs.graylog.org/en/4.0/pages/installation/docker.html?highlight=docker

然后我稍微修正了appsettings.json文件:

{
  "Logging": {
    "Console": {
      "LogLevel": {
        "Default": "Debug"
      }
    },
    "GELF": {
      "Host": "127.0.0.1",
      "Port": 12201,
      "LogSource": "console-app-1",
      "LogLevel": {
        "Default": "Debug",
        "Microsoft": "Debug",
        "Gelf.Extensions.Logging.Samples.NetCore2": "Debug",
        "Gelf.Extensions.Logging.Samples.NetCore2.Program": "Debug"
      },
      "LogLevel2": {
        "Microsoft.AspNetCore.Mvc.Razor": "Error",
        "Default": "Trace"
      },
      "AdditionalFields": {
        "project_name": "my-project"
      }
    }
  }
}

运行 应用程序,它可以工作,但是当我转到浏览器时 http://localhost:9000/search?q=&运行getype=relative&relative=1800 我没有看到任何记录。 我做错了什么?

需要检查 Docker GrayLog 配置:尤其是 GELF 输入本地和全局。