{"id":19133580,"url":"https://github.com/hashload/horse-logger-provider-console","last_synced_at":"2026-02-04T14:04:49.607Z","repository":{"id":45220843,"uuid":"335328749","full_name":"HashLoad/horse-logger-provider-console","owner":"HashLoad","description":"Horse Logger - Provider Console","archived":false,"fork":false,"pushed_at":"2025-06-10T19:22:35.000Z","size":42,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-01T14:29:54.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pascal","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/HashLoad.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}},"created_at":"2021-02-02T15:09:00.000Z","updated_at":"2025-06-10T19:22:05.000Z","dependencies_parsed_at":"2023-09-25T23:30:45.517Z","dependency_job_id":"6e3cdf1d-eadf-406e-a5e2-3923c248e896","html_url":"https://github.com/HashLoad/horse-logger-provider-console","commit_stats":{"total_commits":16,"total_committers":4,"mean_commits":4.0,"dds":0.5625,"last_synced_commit":"86ffbd49ac0ae427e8c43472e32ac8ab26b51688"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/HashLoad/horse-logger-provider-console","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-logger-provider-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-logger-provider-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-logger-provider-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-logger-provider-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HashLoad","download_url":"https://codeload.github.com/HashLoad/horse-logger-provider-console/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-logger-provider-console/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263339939,"owners_count":23451518,"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","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":[],"created_at":"2024-11-09T06:22:59.603Z","updated_at":"2026-02-04T14:04:49.573Z","avatar_url":"https://github.com/HashLoad.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# horse-logger-provider-console\n\u003cb\u003ehorse-logger-provider-console\u003c/b\u003e is an official \u003ca href=\"https://github.com/HashLoad/horse-logger\"\u003ehorse-logger\u003c/a\u003e middleware provider to print the logs of an API developed using the \u003ca href=\"https://github.com/HashLoad/horse\"\u003eHorse\u003c/a\u003e framework, on console. We created a channel on Telegram for questions and support:\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://t.me/hashload\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/telegram-join%20channel-7289DA?style=flat-square\"\u003e\n\u003c/a\u003e\n\n## ⭕ Prerequisites\n[**horse-logger**](https://github.com/HashLoad/horse-logger) - Official middleware for logging in APIs developed with the Horse framework.\u003cbr\u003e\n[**horse-utils-clientip**](https://github.com/dliocode/horse-utils-clientip) - Capture the client's IP.\n\n*Obs: If you use Boss (dependency manager for Delphi), the jhonson will be installed automatically when installing horse-logger-provider-console.*\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command:\n``` sh\n$ boss install horse-logger-provider-console\n```\nIf you choose to install manually, simply add the following folders to your project, in *Project \u003e Options \u003e Resource Compiler \u003e Directories and Conditionals \u003e Include file search path*\n```\n../horse-logger-provider-console/src\n```\n\n## ✔️ Compatibility\nThis middleware is compatible with projects developed in:\n- [X] Delphi\n- [X] Lazarus\n\n## 🔠 Formatting\nYou can format the log output:\n\nDefault: `${request_clientip} [${time}] ${request_user_agent} \"${request_method} ${request_path_info} ${request_version}\" ${response_status} ${response_content_length}`\n\nPossible values: `time`,`time_short`,`execution_time`,`request_clientip`,`request_method`,`request_version`,`request_url`,`request_query`,`request_path_info`,`request_path_translated`,`request_cookie`,`request_accept`,`request_from`,`request_host`,`request_referer`,`request_user_agent`,`request_connection`,`request_derived_from`,`request_remote_addr`,`request_remote_host`,`request_script_name`,`request_server_port`,`request_remote_ip`,`request_internal_path_info`,`request_raw_path_info`,`request_cache_control`,`request_script_name`,`request_authorization`,`request_content_encoding`,`request_content_type`,`request_content_length`,`request_content_version`,`request_content`,`response_version`,`response_reason`,`response_server`,`response_realm`,`response_allow`,`response_location`,`response_log_message`,`response_title`,`response_content_encoding`,`response_content_type`,`response_content_length`,`response_content_version`,`response_content`,`response_status`\n\n## ⚡️ Quickstart Delphi\n```delphi\nuses\n  Horse,\n  Horse.Logger, // It's necessary to use the unit\n  Horse.Logger.Provider.Console, // It's necessary to use the unit\n  System.SysUtils;\n\n// var\n//   LLogFileConfig: THorseLoggerConsoleConfig;\n\nbegin\n  // LLogFileConfig := THorseLoggerConsoleConfig.New\n  //   .SetLogFormat('${request_clientip} [${time}] ${response_status}');\n\n  // You can also specify the log format:\n  // THorseLoggerManager.RegisterProvider(THorseLoggerProviderConsole.New(LLogFileConfig));\n\n  // Here you will define the provider that will be used.\n  THorseLoggerManager.RegisterProvider(THorseLoggerProviderConsole.New());\n\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(THorseLoggerManager.HorseCallback);\n\n  THorse.Get('/ping',\n    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)\n    begin\n      Res.Send('pong');\n    end);\n\n  THorse.Listen(9000);\nend;\n```\n\n## ⚡️ Quickstart Lazarus\n```delphi\n{$MODE DELPHI}{$H+}\n\nuses\n  {$IFDEF UNIX}{$IFDEF UseCThreads}\n  cthreads,\n  {$ENDIF}{$ENDIF}\n  Horse,\n  Horse.Logger, // It's necessary to use the unit\n  Horse.Logger.Provider.Console, // It's necessary to use the unit\n  SysUtils;\n\n// var\n//   LLogFileConfig: THorseLoggerConsoleConfig;\n\nprocedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);\nbegin\n  Res.Send('Pong');\nend;\n\nbegin\n  // LLogFileConfig := THorseLoggerConsoleConfig.New\n  //   .SetLogFormat('${request_clientip} [${time}] ${response_status}');\n\n  // You can also specify the log format:\n  // THorseLoggerManager.RegisterProvider(THorseLoggerProviderConsole.New(LLogFileConfig));\n\n  // Here you will define the provider that will be used.\n  THorseLoggerManager.RegisterProvider(THorseLoggerProviderConsole.New());\n\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(THorseLoggerManager.HorseCallback);\n\n  THorse.Get('/ping', GetPing);\n\n  THorse.Listen(9000);\nend.\n```\n\n## 📝 Output samples\nUsing default log formatting, the output will look something like this:\n![image](https://user-images.githubusercontent.com/16382981/136378628-30c7fa6f-7d27-4faa-a8f9-7356b547099a.png)\n\n## ⚠️ License\n`horse-logger-provider-console` is free and open-source middleware licensed under the [MIT License](https://github.com/HashLoad/horse-logger-provider-console/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashload%2Fhorse-logger-provider-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashload%2Fhorse-logger-provider-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashload%2Fhorse-logger-provider-console/lists"}