{"id":20905190,"url":"https://github.com/akkadotnet/akka.logger.log4net","last_synced_at":"2026-02-10T23:05:14.078Z","repository":{"id":60774035,"uuid":"51956199","full_name":"akkadotnet/Akka.Logger.log4net","owner":"akkadotnet","description":"Akka.NET logging integration for Log4Net library","archived":false,"fork":false,"pushed_at":"2025-11-21T11:15:27.000Z","size":4491,"stargazers_count":4,"open_issues_count":2,"forks_count":7,"subscribers_count":10,"default_branch":"dev","last_synced_at":"2026-01-07T16:28:18.159Z","etag":null,"topics":["akka","akkadotnet","log4net"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akkadotnet.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":"2016-02-17T21:21:24.000Z","updated_at":"2024-07-26T16:02:40.000Z","dependencies_parsed_at":"2024-07-26T17:41:28.696Z","dependency_job_id":"745c1ce9-ffd7-48b1-99e5-b0cb6d478007","html_url":"https://github.com/akkadotnet/Akka.Logger.log4net","commit_stats":null,"previous_names":["akkadotnet/akka.logger.log4net","akkanetcontrib/akka.logger.log4net"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/akkadotnet/Akka.Logger.log4net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkadotnet%2FAkka.Logger.log4net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkadotnet%2FAkka.Logger.log4net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkadotnet%2FAkka.Logger.log4net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkadotnet%2FAkka.Logger.log4net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akkadotnet","download_url":"https://codeload.github.com/akkadotnet/Akka.Logger.log4net/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkadotnet%2FAkka.Logger.log4net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29321276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["akka","akkadotnet","log4net"],"created_at":"2024-11-18T13:23:01.651Z","updated_at":"2026-02-10T23:05:14.053Z","avatar_url":"https://github.com/akkadotnet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Akka.Logger.log4net\n\n- This plugin integrates log4net with Akka.NET, and enhances your Akka.NET logging capabilities by integrating with log4net. For detailed usage and configuration examples, see the sections below or explore our [documentation](http://getakka.net/articles/utilities/logging.html).\n\n- Currently targetting Log4Net 2.0.17\n\n## Using the log4net Logger Integration\n\nWith log4net, you can enrich your logs with both custom and automatic context information, such as file names, line numbers, and method names. This makes your logs more informative and easier to trace.\n\n### Obtaining an ILoggerAdapter with Contextual Logging\n\nUse `Log4NetLoggingAdapterExtensions` to get an `ILoggerAdapter` that supports enriched logging:\n\n#### Examples\n\n##### Logging with Automatic Context Information\n\nSimply calling `ForContext` without arguments adds useful context like file name, line number, and method name to your logs:\n\n```csharp\nvar logger = Context.GetLogger().ForContext();\n\nlogger.Info(\"This log includes automatic context information.\");\n```\n\n##### Logging with Custom Properties\n\nAdd custom properties to your logs as follows:\n\n```csharp\nvar logger = Context.GetLogger()\n    .ForContext(\"CustomProperty1\", \"CustomValue1\")\n    .ForContext(\"CustomProperty2\", \"CustomValue2\");\n\nlogger.Info(\"This log has custom properties.\");\n```\n\nOr, use a dictionary for multiple properties (an enumerable of key-value pairs):\n\n```csharp\nvar properties = new Dictionary\u003cstring, object?\u003e\n{\n    [\"UserId\"] = \"user123\",\n    [\"Operation\"] = \"UpdateProfile\"\n};\n\nvar logger = Context.GetLogger().ForContext(properties);\nlogger.Info(\"User profile updated.\");\n```\n\nThis will log a message with custom properties `UserId` and `Operation`, along with the source file name, line number, and method name.\n\n\n### Configuring log4net for Custom Properties\n\nTo include custom properties in your logs, configure log4net like this:\n\n```xml\n\u003clog4net\u003e\n  \u003cappender name=\"ConsoleAppender\" type=\"log4net.Appender.ConsoleAppender\"\u003e\n\t\u003clayout type=\"log4net.Layout.PatternLayout\"\u003e\n\t  \u003cconversionPattern value=\"%date [%thread] [%file(%line)] [%property{LogSource} - %property{ActorPath}] %-5level %logger - UserId=%property{UserId}, Operation=%property{Operation} %class.%method - %message%newline\" /\u003e\n\t\u003c/layout\u003e\n  \u003c/appender\u003e\n  \u003croot\u003e\n\t\u003clevel value=\"INFO\" /\u003e\n\t\u003cappender-ref ref=\"ConsoleAppender\" /\u003e\n  \u003c/root\u003e\n\u003c/log4net\u003e\n```\n\nThis setup ensures your logs include all the specified details, making them more informative and easier to navigate.\n\n### Conclusion\n\nThe log4net integration enhances Akka.NET's logging by allowing for detailed contextual information in logs. This not only improves diagnostics but also aids in understanding the execution flow and context of log messages.\n\n## Maintainer\n\n- Akka.NET Team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkadotnet%2Fakka.logger.log4net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakkadotnet%2Fakka.logger.log4net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkadotnet%2Fakka.logger.log4net/lists"}