Catalog · How the catalog works
horse-logger
Middleware for access logging in HORSE
- ★ 46 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
horse-logger
horse-logger is an official middleware for logging in APIs developed with the Horse framework.
We created a channel on Telegram for questions and support:
⚙️ Installation
Installation is done using the boss install command:
boss install horse-loggerIf you choose to install manually, simply add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path
../horse-logger/src✔️ Compatibility
This middleware is compatible with projects developed in:
- [X] Delphi
- [X] Lazarus
🧬 Official Providers
| Provider | Delphi | Lazarus |
|---|---|---|
| console | ✔️ | ✔️ |
| file | ✔️ | ✔️ |
⚡️ Quickstart & Samples
We provide a complete, real-life sample project showing how to integrate horse-logger with a custom text file log provider and handle exceptions globally. You can find it in the samples/ folder.
Registering custom providers and handling logging errors:
uses
Horse,
Horse.Logger.Manager,
Horse.Logger.Provider.Contract;
begin
// Set global handler for logging errors (optional but recommended)
THorseLoggerManager.OnError := procedure(const AProvider: IHorseLoggerProvider; const AException: Exception)
begin
Writeln('Log Provider ' + AProvider.ClassName + ' failed: ' + AException.Message);
end;
// Register your custom providers
THorseLoggerManager.RegisterProvider(TMyCustomLogProvider.Create);
// Enable middleware
THorse.Use(THorseLoggerManager.HorseCallback);
THorse.Listen(9000);
end.⚠️ License
horse-logger is free and open-source middleware licensed under the MIT License.

