{"id":18331979,"url":"https://github.com/mrousavy/metalog","last_synced_at":"2025-08-30T12:14:23.551Z","repository":{"id":78946233,"uuid":"102129326","full_name":"mrousavy/MetaLog","owner":"mrousavy","description":"📝 Simple, yet effective, logging with Metadata CallerInfo for creating beautiful Log files in C#/VB .NET","archived":false,"fork":false,"pushed_at":"2020-06-18T08:40:53.000Z","size":84,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T08:51:14.530Z","etag":null,"topics":["c-sharp","csharp","log","logger","logging","metadata"],"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/mrousavy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"mrousavy","ko_fi":"mrousavy","custom":["https://paypal.me/mrousavy"]}},"created_at":"2017-09-01T15:54:48.000Z","updated_at":"2025-02-24T03:26:35.000Z","dependencies_parsed_at":"2023-02-24T23:00:21.024Z","dependency_job_id":null,"html_url":"https://github.com/mrousavy/MetaLog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrousavy/MetaLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FMetaLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FMetaLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FMetaLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FMetaLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrousavy","download_url":"https://codeload.github.com/mrousavy/MetaLog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FMetaLog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272847029,"owners_count":25003116,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"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":["c-sharp","csharp","log","logger","logging","metadata"],"created_at":"2024-11-05T19:36:40.920Z","updated_at":"2025-08-30T12:14:23.534Z","avatar_url":"https://github.com/mrousavy.png","language":"C#","funding_links":["https://github.com/sponsors/mrousavy","https://ko-fi.com/mrousavy","https://paypal.me/mrousavy","https://ko-fi.com/F1F8CLXG'"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg align=\"right\" src=\"https://github.com/mrousavy/MetaLog/raw/master/Images/file_icon.ico\" alt=\"Icon\"\u003e\n  \u003ch1 align=\"left\"\u003eMetaLog\u003c/h1\u003e\n  \u003cblockquote align=\"left\"\u003e\u003cstrong\u003eSimple, yet effective, logging with Metadata CallerInfo for creating beautiful Log files in C#/VB .NET\u003c/strong\u003e\u003c/blockquote\u003e\n\u003c/p\u003e\n\n\u003e _.NET Standard 2.0 Class Library_\n\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/u3sp06j9n72sb8t5?svg=true)](#MetaLog) [![NuGet package downloads](https://img.shields.io/nuget/dt/MetaLog.svg)](http://nuget.org/packages/MetaLog)\n\nInstall via **NuGet Package Manager**:\n```pm\nPM\u003e Install-Package MetaLog\n```\n\n# Usage\n### Namespace\n```cs\nusing MetaLog;\n```\n\n### Using the `ILogger`\n```cs\n// create a new Logger with log file at Documents\\\\log.log, and minimum log severity \"Info\"\nILogger logger = Logger.New(\"C:\\\\Users\\\\mrousavy\\\\Documents\\\\log.log\", LogSeverity.Info);\n\nlogger.Log(LogSeverity.Info, \"Logged in as mrousavy, version 1.0!\");\n// or: logger.Info(..);\n\n/// Output (log.log):\n/// [Info] [2017-09-01 20:37:02.755] [StaticTests.CustomTest:16]: Logged in as mrousavy, version 1.0!\n```\n\n### Using Streams\n```cs\n// create a new Logger with stream to log file at Documents\\\\log.log, and minimum log severity \"Info\"\nusing(ILogger logger = Logger.New(\"C:\\\\Users\\\\mrousavy\\\\Documents\\\\log.log\", LogSeverity.Info, true)) {\n  logger.Log(LogSeverity.Info, \"Logged in as mrousavy, version 1.0!\");\n} //will call Dispose() here, you can also call it manually without the using(..){..} directive\n\n/// Output (log.log):\n/// [Info] [2017-09-01 20:37:02.755] [StaticTests.CustomTest:16]: Logged in as mrousavy, version 1.0!\n```\n\n### Async\n```cs\nawait logger.LogAsync(LogSeverity.Info, \"Logged in as mrousavy, version 1.0!\");\n\n/// Output (log.log):\n/// [Info] [2017-09-01 20:37:02.755] [StaticTests.CustomTest:16]: Logged in as mrousavy, version 1.0!\n```\n\n### The Exception Tree\n```cs\ntry {\n  // something that will throw\n} catch (Exception ex) {\n  logger.Log(LogSeverity.Error, ex);\n}\n\n/// Output (log.log):\n/// [Error]    [2017-09-01 20:53:27.936] [StaticTests.CustomTest:20]:             BEGIN EXCEPTION TREE:\n///   ┌ System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\\Users\\mrousavy\\test.txt'.\n///   ├ ┬ at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\n///   ├ ├    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, /// SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\n///   ├ ├    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\n///   ├ ├    at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)\n///   ├ ├    at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)\n///   ├ ├    at System.IO.File.ReadAllText(String path)\n///   └ └    at MetaLog.Tests.StaticTests.CustomTest() in D:\\Projects\\MetaLog\\MetaLog.Tests\\StaticTests.cs:line 18\n\n```\n\n### Using the static `Logger` class\n```cs\nLogger.LogFile = \"C:\\\\Users\\\\mrousavy\\\\Documents\\\\log.log\";\nLogger.UseStream = true; //create a new Stream to the File, set to false to dispose the Stream\n\nLogger.Log(LogSeverity.Info, \"Logged in as mrousavy, version 1.0!\");\n\n/// Output (log.log):\n/// [Info] [2017-09-01 20:37:02.755] [StaticTests.CustomTest:16]: Logged in as mrousavy, version 1.0!\n```\n\n# Performance\n![.NET Unit-Test Results](https://github.com/mrousavy/MetaLog/raw/master/Images/Tests_Screenshot.png)\n\n# License\n\u003e Thanks for using **MetaLog**! License: [MIT](https://github.com/mrousavy/MetaLog/blob/master/LICENSE), [mrousavy](http://github.com/mrousavy) 2017\n\n\u003ca href='https://ko-fi.com/F1F8CLXG' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Fmetalog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrousavy%2Fmetalog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Fmetalog/lists"}