{"id":18855503,"url":"https://github.com/springhgui/serilog-sinks-skywalking","last_synced_at":"2025-04-14T11:05:41.290Z","repository":{"id":65773751,"uuid":"504089733","full_name":"SpringHgui/serilog-sinks-skywalking","owner":"SpringHgui","description":"Write Serilog log events to skywalking apm","archived":false,"fork":false,"pushed_at":"2023-02-09T06:05:37.000Z","size":26,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T11:05:33.672Z","etag":null,"topics":["aspnetcore","serilog","sink","skywalking"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpringHgui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T09:17:57.000Z","updated_at":"2024-07-11T09:43:25.000Z","dependencies_parsed_at":"2023-03-01T19:45:56.225Z","dependency_job_id":null,"html_url":"https://github.com/SpringHgui/serilog-sinks-skywalking","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2Fserilog-sinks-skywalking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2Fserilog-sinks-skywalking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2Fserilog-sinks-skywalking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringHgui%2Fserilog-sinks-skywalking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpringHgui","download_url":"https://codeload.github.com/SpringHgui/serilog-sinks-skywalking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868768,"owners_count":21174757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnetcore","serilog","sink","skywalking"],"created_at":"2024-11-08T03:54:06.815Z","updated_at":"2025-04-14T11:05:41.276Z","avatar_url":"https://github.com/SpringHgui.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serilog-sinks-skywalking\n[![Nuget](https://img.shields.io/nuget/v/Serilog.Sinks.Skywalking)](https://www.nuget.org/packages/Serilog.Sinks.Skywalking/)\n\nWrite Serilog events to skywalking apm\n\n# 使用\n\n1. 集成[SkyAPM.Agent.AspNetCore](https://github.com/SkyAPM/SkyAPM-dotnet)\n2. 集成[Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore)\n3. 安装nuget包 `Serilog.Sinks.Skywalking`\n```c#\npublic static IHostBuilder CreateHostBuilder(string[] args) =\u003e\n        Host.CreateDefaultBuilder(args)\n            .UseSerilog((context, services, configuration) =\u003e\n            {\n                configuration\n                .MinimumLevel.Debug()\n                .Enrich.FromLogContext()\n                .WriteTo.Skywalking(services) //添加这一行\n                .WriteTo.Console();\n            }) \n            .ConfigureWebHostDefaults(webBuilder =\u003e\n            {\n                webBuilder.UseStartup\u003cStartup\u003e();\n            });\n```\n\n或者在 `MiniApi`项目中\n\n```c#\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Host.UseSerilog((context, services, configuration) =\u003e\n{\n    configuration\n       .MinimumLevel.Debug()\n       .Enrich.FromLogContext()\n       .WriteTo.Skywalking(services) //添加这一行\n       .WriteTo.Console();\n});\n```\n\n# 高级\n自定义Formater\n\n```c#\nconfiguration\n    .WriteTo.Skywalking(services, new JsonFormatter())\n```\n更多Formatter实现查看Serilog文档，或自行实现`ITextFormatter`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringhgui%2Fserilog-sinks-skywalking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringhgui%2Fserilog-sinks-skywalking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringhgui%2Fserilog-sinks-skywalking/lists"}