{"id":18246604,"url":"https://github.com/datvm/dailytracelistener","last_synced_at":"2025-10-24T16:02:44.275Z","repository":{"id":143659090,"uuid":"153922631","full_name":"datvm/DailyTraceListener","owner":"datvm","description":"A small and simple TraceListener for .NET that writes log files by day.","archived":false,"fork":false,"pushed_at":"2018-10-20T16:16:02.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-23T04:04:24.795Z","etag":null,"topics":["csv","logger","logging","netcore","netcore2","netframework","netstandard20","trace","tracelistener","tracing"],"latest_commit_sha":null,"homepage":null,"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/datvm.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.MD","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":"2018-10-20T15:58:46.000Z","updated_at":"2019-09-15T20:14:23.000Z","dependencies_parsed_at":"2023-06-03T03:30:33.455Z","dependency_job_id":null,"html_url":"https://github.com/datvm/DailyTraceListener","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/datvm/DailyTraceListener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datvm%2FDailyTraceListener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datvm%2FDailyTraceListener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datvm%2FDailyTraceListener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datvm%2FDailyTraceListener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datvm","download_url":"https://codeload.github.com/datvm/DailyTraceListener/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datvm%2FDailyTraceListener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273279329,"owners_count":25077313,"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-09-02T02:00:09.530Z","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":["csv","logger","logging","netcore","netcore2","netframework","netstandard20","trace","tracelistener","tracing"],"created_at":"2024-11-05T09:26:56.951Z","updated_at":"2025-10-24T16:02:44.203Z","avatar_url":"https://github.com/datvm.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"`DailyTraceListener` is a small and simple and highly customizable [`TraceListener`](https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/trace-listeners) for .NET that writes log files by day.\n\nThis package is written in .NET Standard 2.0 so it can be used by both .NET Framework 4.6.2 and .NET Core 2.0 upward.\n\nYou can check [the Demo file here](https://github.com/datvm/DailyTraceListener/blob/master/DailyTraceListener.Demo/Program.cs).\n\n# Installation\n\nYou can get the package from [NuGet](https://www.nuget.org/packages/DailyTraceListener/):\n\n\u003e Install-Package DailyTraceListener\n\n# Getting Started\n\nYou can use it as any other `TraceListener`:\n\n```\nvar traceListener = new DailyTraceListener(\"Logs\");\nTrace.Listeners.Add(traceListener);\n```\n\nIn the above code, `\"Logs\"` parameter is the path to the folder where the log files are written. If the folder does not exist, the class will create it automatically.\n\nNow you can use `Trace`:\n\n```\nTrace.TraceInformation(\"Hello\");\nTrace.TraceWarning(\"Some warning\");\nTrace.TraceError(new Exception(\"A complete \\\"error\\\" message with\\r\\nmultiple lines.\").ToString());\n```\n\nBy default implementation, `DailyTraceListener` write a format similar to CSV so you can always change the extension to `.csv` and read with Excel or any program of your choice.\n\n# Options\n\nCurrently there are two options you can use in addition. Please note both options should be set up before using for consistency:\n\n```\nvar traceListener = new DailyTraceListener(\"Logs\")\n    .UseHeader()\n    .UseUtc();\n```\n\n## UseHeader()\n\nThis option will write a header to the log file when it write a new file. The header is simply a string, and by default implementation, it's a CSV header. You can override this behavior by overriding the [`WriteHeader`](https://github.com/datvm/DailyTraceListener/blob/master/DailyTraceListener/DailyTraceListener.cs) method.\n\n## UseUtc()\n\nUse UTC time instead of local machine time.\n\n# Customization\n\nThe following methods are `virtual` meaning you can override them if you need: `WriteHeader`, `FormatTime` (used by default `TraceEvent` implementation of `DailyTraceListener`). In addition, `TraceEvent`, `Write` and `WriteLine` are already virtual by its base class `TraceListener`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatvm%2Fdailytracelistener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatvm%2Fdailytracelistener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatvm%2Fdailytracelistener/lists"}