{"id":13430825,"url":"https://github.com/serilog/serilog","last_synced_at":"2026-10-18T22:29:32.036Z","repository":{"id":6946743,"uuid":"8198511","full_name":"serilog/serilog","owner":"serilog","description":"Simple .NET logging with fully-structured events","archived":false,"fork":false,"pushed_at":"2026-10-13T03:39:02.000Z","size":76353,"stargazers_count":8052,"open_issues_count":21,"forks_count":870,"subscribers_count":161,"default_branch":"dev","last_synced_at":"2026-10-16T23:08:39.261Z","etag":null,"topics":["serilog"],"latest_commit_sha":null,"homepage":"https://serilog.net","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serilog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2013-02-14T11:44:03.000Z","updated_at":"2026-10-16T12:57:55.000Z","dependencies_parsed_at":"2026-09-25T10:28:27.964Z","dependency_job_id":null,"html_url":"https://github.com/serilog/serilog","commit_stats":{"total_commits":1521,"total_committers":145,"mean_commits":"10.489655172413793","dds":0.559500328731098,"last_synced_commit":"fdf4a4872b4effd02dcd7d788e45b6b8ffdfa2fc"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/serilog/serilog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serilog%2Fserilog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serilog%2Fserilog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serilog%2Fserilog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serilog%2Fserilog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serilog","download_url":"https://codeload.github.com/serilog/serilog/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serilog%2Fserilog/sbom","scorecard":{"id":812661,"data":{"date":"2025-08-11","repo":{"name":"github.com/serilog/serilog","commit":"e378f333b555c42f8530bb8d1ef1b8dfb8740d83"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.1,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/ci.yml:22","Warn: no topLevel permission defined: .github/workflows/ci.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":4,"reason":"Found 10/24 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":9,"reason":"1 commit(s) and 10 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/serilog/serilog/ci.yml/dev?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/serilog/serilog/ci.yml/dev?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v4.3.0 not signed: https://api.github.com/repos/serilog/serilog/releases/219362879","Warn: release artifact v4.2.0 not signed: https://api.github.com/repos/serilog/serilog/releases/189326744","Warn: release artifact v4.1.0 not signed: https://api.github.com/repos/serilog/serilog/releases/181131024","Warn: release artifact v4.0.2 not signed: https://api.github.com/repos/serilog/serilog/releases/177439875","Warn: release artifact v4.0.1 not signed: https://api.github.com/repos/serilog/serilog/releases/167042945","Warn: release artifact v4.3.0 does not have provenance: https://api.github.com/repos/serilog/serilog/releases/219362879","Warn: release artifact v4.2.0 does not have provenance: https://api.github.com/repos/serilog/serilog/releases/189326744","Warn: release artifact v4.1.0 does not have provenance: https://api.github.com/repos/serilog/serilog/releases/181131024","Warn: release artifact v4.0.2 does not have provenance: https://api.github.com/repos/serilog/serilog/releases/177439875","Warn: release artifact v4.0.1 does not have provenance: https://api.github.com/repos/serilog/serilog/releases/167042945"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T13:32:02.826Z","repository_id":6946743,"created_at":"2025-08-23T13:32:02.826Z","updated_at":"2025-08-23T13:32:02.826Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344836268,"owners_count":38332523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-17T02:00:06.547Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["serilog"],"created_at":"2024-07-31T02:00:58.144Z","updated_at":"2026-10-18T22:29:32.028Z","avatar_url":"https://github.com/serilog.png","language":"C#","funding_links":[],"categories":["Frameworks, Libraries and Tools","C# #","C#","框架, 库和工具","Logging","Libraries","Libraries, Frameworks and Tools","C\\#","日志","🗒️ Cheatsheets","Parsing","Utilities"],"sub_categories":["Logging","日志","GUI - other","📦 Libraries","Logging and Configuration"],"readme":"# Serilog\u0026nbsp;[![Build status](https://github.com/serilog/serilog/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/serilog/serilog/actions)\u0026nbsp;[![NuGet Version](https://img.shields.io/nuget/v/Serilog.svg?style=flat)](https://www.nuget.org/packages/Serilog/)\u0026nbsp;[![NuGet Downloads](https://img.shields.io/nuget/dt/serilog.svg)](https://www.nuget.org/packages/Serilog/)\u0026nbsp;[![Stack Overflow](https://img.shields.io/badge/stack%20overflow-serilog-orange.svg)](https://stackoverflow.com/questions/tagged/serilog)\n\nSerilog is a diagnostic logging library for .NET applications. It is easy to set up, has a clean API, and runs on all recent .NET platforms. While it's useful even in the simplest applications, Serilog's support for structured logging shines when instrumenting complex, distributed, and asynchronous applications and systems.\n\n[![Serilog](https://raw.githubusercontent.com/serilog/serilog.github.io/master/images/serilog-180px.png)](https://serilog.net)\n\nLike many other libraries for .NET, Serilog provides diagnostic logging to [files](https://github.com/serilog/serilog-sinks-file), the [console](https://github.com/serilog/serilog-sinks-console), and [many other outputs](https://github.com/serilog/serilog/wiki/Provided-Sinks).\n\n```csharp\nusing var log = new LoggerConfiguration()\n    .WriteTo.Console()\n    .WriteTo.File(\"log.txt\")\n    .CreateLogger();\n\nlog.Information(\"Hello, Serilog!\");\n```\n\nUnlike other logging libraries, Serilog is built from the ground up to record _structured event data_.\n\n```csharp\nvar position = new { Latitude = 25, Longitude = 134 };\nvar elapsedMs = 34;\n\nlog.Information(\"Processed {@Position} in {Elapsed} ms\", position, elapsedMs);\n```\n\nSerilog uses [message templates](https://messagetemplates.org), a simple DSL that extends .NET format strings with _named_ as well as positional parameters. Instead of formatting events immediately into text, Serilog captures the values associated with each named parameter.\n\nThe example above records two properties, `Position` and `Elapsed`, in the log event. The `@` operator in front of `Position` tells Serilog to _serialize_ the object passed in, rather than convert it using `ToString()`. Serilog's deep and rich support for structured event data opens up a huge range of diagnostic possibilities not available when using traditional loggers.\n\nRendered into [JSON format](https://github.com/serilog/serilog-formatting-compact) for example, these properties appear alongside the timestamp, level, and message like:\n\n```json\n{\"Position\": {\"Latitude\": 25, \"Longitude\": 134}, \"Elapsed\": 34}\n```\n\nBack-ends that are capable of recording structured event data make log searches and analysis possible without log parsing or regular expressions.\n\nSupporting structured data doesn't mean giving up text: when Serilog writes events to files or the console, the template and properties are rendered into friendly human-readable text just like a traditional logging library would produce:\n\n```\n09:14:22 [INF] Processed {\"Latitude\": 25, \"Longitude\": 134} in 34 ms.\n```\n\n\u003e **Upgrading from an earlier Serilog version?** Find [release notes here](https://github.com/serilog/serilog/releases).\n\n### Features\n\n * **Community-backed and actively developed**\n * Format-based logging API with familiar [levels](https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level) like `Debug`, `Information`, `Warning`, `Error`, and so-on\n * Discoverable C# configuration syntax and optional [XML](https://github.com/serilog/serilog-settings-appsettings) or [JSON](https://github.com/serilog/serilog-settings-configuration) configuration support\n * Efficient when enabled, extremely low overhead when a logging level is switched off\n * Mature [OpenTelemetry Protocol (OTLP)](https://github.com/serilog/serilog-sinks-opentelemetry) support\n * Best-in-class .NET Core support, including [rich integration with ASP.NET Core](https://github.com/serilog/serilog-aspnetcore)\n * A [comprehensive range of sinks](https://github.com/serilog/serilog/wiki/Provided-Sinks), including files, the console, on-premises and cloud-based log servers, databases, and message queues\n * Sophisticated [enrichment](https://github.com/serilog/serilog/wiki/Enrichment) of log events with contextual information, including scoped (`LogContext`) properties, thread and process identifiers, and domain-specific correlation ids such as `HttpRequestId`\n * Zero-shared-state `Logger` objects, with an optional global static `Log` class\n * A lightweight, OpenTelemetry-compatible [tracing extension](https://github.com/serilog-tracing/serilog-tracing)\n * Format-agnostic logging pipeline that can emit events in plain text, JSON, in-memory `LogEvent` objects (including [Rx pipelines](https://github.com/serilog/serilog-sinks-observable)) and other formats\n\n### Getting started\n\nSerilog is installed [from NuGet](https://nuget.org/packages/serilog). To view log events, one or more sinks need to be installed as well, here we'll use the pretty-printing console sink, and a rolling file set:\n\n```\ndotnet add package Serilog\ndotnet add package Serilog.Sinks.Console\ndotnet add package Serilog.Sinks.File\n```\n\nThe simplest way to set up Serilog is using the static `Log` class. A `LoggerConfiguration` is used to create and assign the default logger, normally in _Program.cs_:\n\n```csharp\nusing Serilog;\n\nLog.Logger = new LoggerConfiguration()\n    .WriteTo.Console()\n    .WriteTo.File(\"log.txt\",\n        rollingInterval: RollingInterval.Day,\n        rollOnFileSizeLimit: true)\n    .CreateLogger();\n\ntry\n{\n    // Your program here...\n    const string name = \"Serilog\";\n    Log.Information(\"Hello, {Name}!\", name);\n    throw new InvalidOperationException(\"Oops...\");\n}\ncatch (Exception ex)\n{\n    Log.Error(ex, \"Unhandled exception\");\n}\nfinally\n{\n    await Log.CloseAndFlushAsync(); // ensure all logs written before app exits\n}\n```\n\nFind more, including a runnable example application, under the [Getting Started topic](https://github.com/serilog/serilog/wiki/Getting-Started) in the [documentation](https://github.com/serilog/serilog/wiki/).\n\n### Getting help\n\nTo learn more about Serilog, check out the [documentation](https://github.com/serilog/serilog/wiki) - you'll find information there on the most common scenarios. If Serilog isn't working the way you expect, you may find the [troubleshooting guide](https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics) useful.\n\nSerilog has an active and helpful community who are happy to help point you in the right direction or work through any issues you might encounter. We welcome reproducible bug reports and detailed feature requests through [our GitHub issue tracker](https://github.com/serilog/serilog/issues).\n\n### Maintenance status\n\nAll projects in the https://github.com/serilog GitHub organization are actively maintained, on varying development cadences. Legacy/unmaintained projects are preserved in the [Serilog Archive](https://github.com/serilog-archive).\n\n### Contributing\n\nWould you like to help make Serilog even better? We keep a list of issues that are approachable for newcomers under the [up-for-grabs](https://github.com/issues?utf8=✓\u0026q=is%3Aopen+is%3Aissue+archived%3Afalse+user%3Aserilog+label%3Aup-for-grabs) label (accessible only when logged into GitHub).\n\nBefore starting work on a pull request, we suggest commenting on, or raising, an issue on the issue tracker so that we can help and coordinate efforts. Generatively-authored PRs are not reviewed unless previously invited by a project maintainer.\n\nFor further information, check out our [contributing guide](CONTRIBUTING.md) and our [Code of Conduct](CODE_OF_CONDUCT.md).\n\n_Serilog is copyright \u0026copy; Serilog Contributors - Provided under the [Apache License, Version 2.0](https://apache.org/licenses/LICENSE-2.0.html). Needle and thread logo a derivative of work by [Kenneth Appiah](https://www.kensets.com/)._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserilog%2Fserilog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserilog%2Fserilog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserilog%2Fserilog/lists"}