{"id":15039635,"url":"https://github.com/tallesl/net-l","last_synced_at":"2025-08-27T11:07:50.995Z","repository":{"id":24693342,"uuid":"28104588","full_name":"tallesl/net-L","owner":"tallesl","description":"Logging as simple as it can be.","archived":false,"fork":false,"pushed_at":"2021-04-11T20:34:10.000Z","size":566,"stargazers_count":27,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-23T13:43:53.181Z","etag":null,"topics":["csharp","dot-net","log","logging","nuget","zero-configuration"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tallesl.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}},"created_at":"2014-12-16T20:13:07.000Z","updated_at":"2023-07-25T13:54:17.000Z","dependencies_parsed_at":"2022-08-17T17:01:12.529Z","dependency_job_id":null,"html_url":"https://github.com/tallesl/net-L","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tallesl/net-L","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-L","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-L/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-L/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-L/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tallesl","download_url":"https://codeload.github.com/tallesl/net-L/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tallesl%2Fnet-L/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272324316,"owners_count":24914391,"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-27T02:00:09.397Z","response_time":76,"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":["csharp","dot-net","log","logging","nuget","zero-configuration"],"created_at":"2024-09-24T20:43:29.838Z","updated_at":"2025-08-27T11:07:50.976Z","avatar_url":"https://github.com/tallesl.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"#l\"\u003e\r\n        \u003cimg alt=\"logo\" src=\"Logo/logo-200x200.png\"\u003e\r\n    \u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n# L\r\n\r\n[![][build-img]][build]\r\n[![][nuget-img]][nuget]\r\n\r\nLogging as simple as it can be.\r\n\r\nMost of the time I don't need a sophisticated logger and I got tired of [configuring the same thing for log4net] over\r\nand over again.\r\n\r\n[build]:                                  https://ci.appveyor.com/project/TallesL/net-L\r\n[build-img]:                              https://ci.appveyor.com/api/projects/status/github/tallesl/net-L?svg=true\r\n[nuget]:                                  https://www.nuget.org/packages/L\r\n[nuget-img]:                              https://badge.fury.io/nu/L.svg\r\n[configuring the same thing for log4net]: https://logging.apache.org/log4net/release/manual/configuration.html\r\n\r\n## Usage\r\n\r\n```cs\r\nusing LLibrary;\r\n\r\nvar myLogger = new L();\r\n\r\nmyLogger.Log(\"INFO\", \"Some information\");\r\nmyLogger.Log(\"ERROR\", new Exception(\"BOOM!\"));\r\n```\r\n\r\nYou can use built-in methods for the classical DEBUG, INFO, WARN, ERROR, FATAL labels (but there's no logging level here, they're just labels):\r\n\r\n```cs\r\nmyLogger.Info(\"Some information\");\r\nmyLogger.Error(new Exception(\"BOOM!\"));\r\n```\r\n\r\nA file named `yyyy-MM-dddd.log` will be created in a `logs` folder (located where the application is running), like `2014-12-16.log` containing:\r\n\r\n```\r\n2014-12-16 19:21:45 INFO  Some information.\r\n2014-12-16 19:21:52 ERROR A System.Exception happened: BOOM!\r\n```\r\n\r\n## Configuration\r\n\r\nThe library works out-of-the-box without configuration, but you can configure a thing or two if you want:\r\n\r\n```cs\r\nvar myLogger = new L(\r\n    // True to use UTC time rather than local time.\r\n    // Defaults to false.\r\n    useUtcTime: true,\r\n\r\n    // If other than null it sets to delete any file in the log folder that is older than the time set.\r\n    // Defaults to null.\r\n    deleteOldFiles: TimeSpan.FromDays(10),\r\n\r\n    // Format string to use when calling DateTime.Format.\r\n    // Defaults to \"yyyy-MM-dd HH:mm:ss\".\r\n    dateTimeFormat: \"dd MMM HH:mm:ss\",\r\n\r\n    // Directory where to create the log files.\r\n    // Defaults to null, which creates a local \"logs\" directory.\r\n    directory: @\"C:\\custom-directory\\my-logs\\\",\r\n\r\n    // Labels enabled to be logged by the library, an attempt to log with a label that is not enabled is ignored (no error is raised), null or empty enables all labels.\r\n    // Defaults to null.\r\n    enabledLabels: \"INFO\", \"ERROR\"\r\n);\r\n```\r\n\r\n## But I want...\r\n\r\nTo restrict the file size?\r\nLog to a database?\r\nWhat about a fancy web interface?\r\n\r\nIf that is the case, this library is not for you.\r\nConsider using other library such as [log4net], [NLog], [ELMAH] or [Logary].\r\n\r\n[log4net]: http://logging.apache.org/log4net\r\n[NLog]:    http://nlog-project.org\r\n[ELMAH]:   https://code.google.com/p/elmah\r\n[Logary]:  http://logary.github.io","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallesl%2Fnet-l","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftallesl%2Fnet-l","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftallesl%2Fnet-l/lists"}