{"id":37044380,"url":"https://github.com/steamcore/tinylogger","last_synced_at":"2026-05-11T21:03:02.718Z","repository":{"id":65912896,"uuid":"225046263","full_name":"steamcore/TinyLogger","owner":"steamcore","description":"Tiny extendable logger that plugins into Microsoft.Extensions.Logging","archived":false,"fork":false,"pushed_at":"2026-04-30T21:54:03.000Z","size":339,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-30T22:06:45.953Z","etag":null,"topics":["colors","console","dotnet","logging"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steamcore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-30T17:25:05.000Z","updated_at":"2026-04-30T21:53:39.000Z","dependencies_parsed_at":"2023-11-25T01:26:06.108Z","dependency_job_id":"2e598668-22a0-4cce-98e5-d3b70f1804c5","html_url":"https://github.com/steamcore/TinyLogger","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/steamcore/TinyLogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamcore%2FTinyLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamcore%2FTinyLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamcore%2FTinyLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamcore%2FTinyLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamcore","download_url":"https://codeload.github.com/steamcore/TinyLogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamcore%2FTinyLogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32479448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["colors","console","dotnet","logging"],"created_at":"2026-01-14T05:07:34.662Z","updated_at":"2026-04-30T23:02:57.140Z","avatar_url":"https://github.com/steamcore.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TinyLogger\n\n[![NuGet](https://img.shields.io/nuget/v/TinyLogger.svg?maxAge=259200)](https://www.nuget.org/packages/TinyLogger/)\n![Build](https://github.com/steamcore/TinyLogger/workflows/Build/badge.svg)\n\nTinyLogger is a lightweight, extendable logging library for .NET developers. It integrates seamlessly with\n`Microsoft.Extensions.Logging` to provide rich console and file logging options, enhanced readability through\ntype-aware color-coded output, and customizable log message formats.\n\n## Table of Contents\n- [Key Features](#key-features)\n- [Simple Example](#simple-example)\n- [More Complex Example](#more-complex-example)\n- [Screenshots](#screenshot-of-consoleapp-sample)\n- [Benefits and Drawbacks](#benefits-and-drawbacks)\n- [How It Works](#how-it-works)\n- [Background Workers](#background-workers)\n\n## Key Features\n- Lightweight and extendable\n- Supports console and file logging\n- Customizable log message formats\n- Type-aware color-coded console output\n- Built on Microsoft.Extensions.Logging\n\n## Simple example\n\nIf builder is an instance of `ILoggingBuilder` you can simply add the console logger like this:\n\n```csharp\nbuilder.AddTinyConsoleLogger();\n```\n\nKeep in mind that the if the standard console logger is in use it may have to be disabled as well,\ncheck out how to do this in the `appsettings.json` file of the generic host sample project.\n\n## More complex example\n\nFor more configuration options and file logging, use `AddTinyLogger` method instead. Checkout the sample\n`ConsoleApp` for a complete example.\n\n```csharp\nbuilder.AddTinyLogger(options =\u003e\n{\n    // Add custom data to log fields\n    options.Extenders.Add(new SampleExceptionExtender());\n\n    // Use a predefined timestamped message template\n    options.Template = MessageTemplates.DefaultTimestamped;\n\n    // Log messages to the console\n    options.AddConsole();\n\n    // Log messages to a static file\n    options.AddFile(\"example.log\");\n\n    // Log messages to rolling files based on timestamp\n    options.AddRollingFile(() =\u003e $\"example-{DateTime.Now:yyyyMMdd-HHmm}.log\");\n});\n```\n\n## Screenshot of ConsoleApp sample\n\n### With TinyLogger\nNotice the different colors for numbers, strings, dates, uris, easily readable lists and dictionaries,\nand so on. Colors are selected based on the underlying data type, even in dictionaries.\n![Screenshot of sample output with TinyLogger](https://raw.githubusercontent.com/steamcore/TinyLogger/4af5e6190a9fd563be7f3b5be9efecfb8efd3d7e/screenshots/tinylogger-screenshot-20200309-after.png \"Screenshot of sample output with TinyLogger\")\n\n### With standard console logger\nThe standard .NET console logger has no spacing between log messages and no color coding except for\nlog levels which makes it very hard to read.\n![Screenshot of sample output with standard console logger](https://raw.githubusercontent.com/steamcore/TinyLogger/4af5e6190a9fd563be7f3b5be9efecfb8efd3d7e/screenshots/tinylogger-screenshot-20200309-before.png \"Screenshot of sample output with standard console logger\")\n\n## Benefits and drawbacks\n\nBecause it is a logger provider like any other you are free to use other loggers as well, TinyLogger won't\nget in your way. And since it is built on top of the standard logging abstractions from Microsoft there is\nno magic other than adding the logging provider and the simple configuration.\n\n## How it works\n\nWhen a log message is received it is passed to an internal message tokenizer which parses the original\nlog format, extracts data from the log message state and creates a list of message tokens which easily\ncan be rendered by any class implementing the `ILogRenderer` interface.\n\nThe console renderer will render tokens containing object values with different colors depending on their\ntype so logs easier to read, while the file logger will render in plain text.\n\nIf you want one log format for the console and one log format for files, you can simply add two instances\nof TinyLogger with different configuration options.\n\n## Background workers\n\nEverything is rendered on background threads to be as non blocking as possible.\n\nThis however means that messages are temporarily stored on a queue until they are ready to be processed\nby a log renderer, which should normally be nearly instantly. But if log messages are produced faster than\ncan be rendered then eventually you may hit the configurable queue depth limit.\n\nIf this happens a decision has to be made whether to keep all messages in which case logging threads will\nbe blocked until the log renderers can catch up, or start discarding messages to give renderers more\nbreathing room.\n\nIt's important to note that the limiting factor here isn't TinyLogger but rather the console itself,\nit can be pretty slow on Windows particularly. File logging is much, MUCH faster.\n\nThe default behavior is to keep all messages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamcore%2Ftinylogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamcore%2Ftinylogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamcore%2Ftinylogger/lists"}