{"id":41285260,"url":"https://github.com/chookees/alog","last_synced_at":"2026-01-23T03:02:29.669Z","repository":{"id":295276508,"uuid":"989677738","full_name":"Chookees/ALog","owner":"Chookees","description":"ALog is a powerful and extensible logging framework built for .NET 8+.","archived":false,"fork":false,"pushed_at":"2025-09-06T14:52:10.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-06T16:29:15.236Z","etag":null,"topics":["async","cross-platform","developer-tools","dotnet8","log-framework","logger","logging","logging-framework","logging-library","open-source","structured-logging"],"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/Chookees.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-24T15:44:08.000Z","updated_at":"2025-09-06T14:52:14.000Z","dependencies_parsed_at":"2025-09-06T17:45:59.634Z","dependency_job_id":null,"html_url":"https://github.com/Chookees/ALog","commit_stats":null,"previous_names":["chookees/alog"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Chookees/ALog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chookees%2FALog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chookees%2FALog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chookees%2FALog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chookees%2FALog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chookees","download_url":"https://codeload.github.com/Chookees/ALog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chookees%2FALog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28679140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"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":["async","cross-platform","developer-tools","dotnet8","log-framework","logger","logging","logging-framework","logging-library","open-source","structured-logging"],"created_at":"2026-01-23T03:01:46.824Z","updated_at":"2026-01-23T03:02:29.665Z","avatar_url":"https://github.com/Chookees.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Download ALog](https://a.fsdn.com/con/app/sf-download-button)](https://sourceforge.net/projects/alog/files/latest/download)\n![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/chookees/alog/total)\n\n# ALog – A Modern, Modular, Cross-Platform Logger for .NET 8+\n\n**ALog** is a powerful and extensible logging framework built for .NET 8+.  \nIt is designed to be simple to use, highly configurable, and ready for modern development across platforms including Windows, Linux, and iOS.\n\n---\n\n## ✨ Features\n\n- ✅ Intuitive API: `Log.Write(...)`, `Log.WriteAsync(...)`\n- ✅ Fully async- and sync-capable\n- ✅ Structured logging with scoped contextual data (`BeginScope(...)`)\n- ✅ Exception logging included\n- ✅ Formatter support (PlainText, JSON, or custom)\n- ✅ Console and file writers (with optional color + rolling)\n- ✅ Log level filtering\n- ✅ Cross-platform compatible\n- ✅ Fluent, builder-style configuration\n- ✅ Minimal setup: `using ALog;` gives access to everything\n\n---\n\n## 🔧 Installation\n\n\u003e ALog is currently under development. You can use it via project reference:\n\n```bash\ngit clone https://github.com/yourusername/ALog.git\n```\n\nReference `ALog.csproj` in your .NET 8+ project.\n\n---\n\n## 🚀 Quick Start\n\n### Step 1: Configure ALog\n\n```csharp\nusing ALog;\n\nvar config = new LoggerConfig()\n    .AddWriter(new ConsoleLogWriter(useColors: true, formatter: new PlainTextFormatter(\"HH:mm:ss\")))\n    .AddWriter(new FileLogWriter(\"logs/app.log\", new JsonFormatter(pretty: true), maxFileSizeInBytes: 1_048_576)) // 1 MB\n    .SetMinimumLevel(LogLevel.Debug);\n\nLog.Init(config);\n```\n\n### Step 2: Start Logging\n\n```csharp\nLog.Write(\"Application started\");\n\nusing (Log.BeginScope(\"userId\", 42))\n{\n    using (Log.BeginScope(\"feature\", \"Login\"))\n    {\n        Log.Write(\"User successfully authenticated\");\n        Log.Write(new Exception(\"Test failure\"), \"Something went wrong\", LogLevel.Error);\n    }\n}\n\nawait Log.WriteAsync(\"Async log message\");\n```\n\n### Step 3: Background Queue (Optional)\n\nFor high-performance scenarios, enable the background queue:\n\n```csharp\nvar config = new LoggerConfig()\n    .AddWriter(new ConsoleLogWriter())\n    .AddWriter(new FileLogWriter(\"logs/app.log\"))\n    .UseBackgroundQueue(enabled: true, capacity: 1000, batchSize: 10, flushInterval: TimeSpan.FromMilliseconds(100))\n    .SetMinimumLevel(LogLevel.Debug);\n\nLog.Init(config);\n\n// Logs are queued and processed in background\nLog.Write(\"This will be processed asynchronously\");\n\n// Flush remaining logs before shutdown\nawait Log.FlushAsync();\n```\n\n### Step 4: Advanced Writers\n\n```csharp\n// HTTP Writer\nvar httpWriter = new HttpLogWriter(\n    endpoint: \"https://api.example.com/logs\",\n    method: HttpMethod.Post,\n    headers: new Dictionary\u003cstring, string\u003e { [\"Authorization\"] = \"Bearer token\" }\n);\n\n// SQL Writer\nvar sqlWriter = new SqlLogWriter(\n    connectionString: \"Server=localhost;Database=Logs;Integrated Security=true;\",\n    tableName: \"ApplicationLogs\"\n);\n\n// Azure Application Insights\nvar azureWriter = new AzureLogWriter(\n    instrumentationKey: \"your-instrumentation-key\"\n);\n\n// AWS CloudWatch\nvar awsWriter = new AwsCloudWatchWriter(\n    logGroupName: \"/aws/application/myapp\",\n    logStreamName: \"main-stream\"\n);\n\nvar config = new LoggerConfig()\n    .AddWriter(httpWriter)\n    .AddWriter(sqlWriter)\n    .AddWriter(azureWriter)\n    .AddWriter(awsWriter);\n```\n\n---\n\n## 🌐 Platform-Specific Paths (Optional)\n\nYou can use built-in `IPlatformHelper` implementations to resolve safe, writeable log paths:\n\n### Windows\n\n```csharp\nusing ALog.Platform.Windows;\n\nvar logPath = new WindowsPlatformHelper().ResolveLogFilePath(\"logs/app.log\");\n```\n\n### Linux\n\n```csharp\nusing ALog.Platform.Linux;\n\nvar logPath = new LinuxPlatformHelper().ResolveLogFilePath(\"logs/app.log\");\n```\n\n### iOS (MAUI / Xamarin)\n\n```csharp\nusing ALog.Platform.iOS;\n\nvar logPath = new IOSPlatformHelper().ResolveLogFilePath(\"logs/app.log\");\n```\n\n\u003e You control the log location – ALog does not enforce platform helpers. They are optional and recommended for mobile or portable environments.\n\n---\n\n## 📦 Writers\n\n| Writer                | Description                                                |\n|-----------------------|------------------------------------------------------------|\n| `ConsoleLogWriter`    | Outputs to console with optional color and formatting      |\n| `FileLogWriter`       | Outputs to file with optional rolling and formatter support|\n| `HttpLogWriter`       | Sends logs to HTTP endpoints (REST APIs, webhooks)         |\n| `SqlLogWriter`        | Stores logs in SQL Server database                         |\n| `AzureLogWriter`      | Sends logs to Azure Application Insights                   |\n| `AwsCloudWatchWriter` | Sends logs to AWS CloudWatch                               |\n\n---\n\n## 🎨 Formatters\n\n| Formatter           | Description                                                |\n|---------------------|------------------------------------------------------------|\n| `PlainTextFormatter`| Developer-friendly, single-line format (customizable time)|\n| `JsonFormatter`     | Structured JSON output, ideal for logs ingestion tools     |\n\n---\n\n## 🧠 Contextual Logging\n\nScoped logging adds temporary key-value pairs that are automatically removed when their scope ends:\n\n```csharp\nusing (Log.BeginScope(\"sessionId\", \"abc123\"))\n{\n    Log.Write(\"User clicked 'Buy'\");\n}\n// sessionId is no longer attached here\n```\n\n\u003e Works automatically with supported formatters like JSON or plain text.\n\n---\n\n## ⚙️ Roadmap\n\n- [x] Scope-based logging (`using Log.BeginScope(...)`)\n- [x] Channel-based async background log queue\n- [x] Additional writers (HTTP, SQL, Azure Application Insights, AWS CloudWatch)\n- [ ] External config via JSON or environment\n- [ ] NuGet package \u0026 logo\n- [ ] Full unit test coverage\n\n---\n\n## 🤝 Contributing\n\nContributions welcome! Fork the repository and submit a PR.\n\nFor ideas like new formatters or writers, feel free to open a discussion first.\n\n---\n\n## 📄 License\n\nMIT © Artur Bobb / Chookees\n\n---\n\n## 👤 Maintainer\n\nBuilt and maintained by **Artur Bobb / Chookees**  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchookees%2Falog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchookees%2Falog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchookees%2Falog/lists"}