LoggerPro is the most complete and battle-tested logging framework for Delphi. Used in thousands of production applications worldwide, it provides everything you need for professional-grade logging.
- Async by Design - Non-blocking logging with zero impact on application performance
- 20+ Built-in Appenders - File, Console, HTTP, Syslog, ElasticSearch, Database, Email, and many more
- Cross-Platform - Windows, Linux, macOS, Android, iOS - write once, log everywhere
- Thread-Safe - Built from the ground up for multi-threaded applications
- Fluent Builder API - Clean, readable, Serilog-style configuration
- Structured Logging - First-class support for key-value context in log messages
- Production Ready - Stable, maintained, and continuously improved since 2010
uses
LoggerPro.GlobalLogger;
begin
Log.Info('Application started');
Log.Debug('Processing item %d', [42], 'WORKER');
Log.Error('Connection failed', 'DATABASE');
end.One line of uses, and you're logging to rotating files. It's that simple.
Log := LoggerProBuilder
.WithDefaultTag('MYAPP')
.WriteToFile
.WithLogsFolder('logs')
.Done
.WriteToConsole.Done
.WriteToHTTP
.WithURL('https://logs.example.com/api')
.Done
.Build;Log.Info('Order completed', 'ORDERS', [
LogParam.I('order_id', 12345),
LogParam.S('customer', 'John Doe'),
LogParam.F('total', 299.99)
]);Option 1: Set Minimum Level (Simple)
// Disable Debug and Info, keep Warnings and above
Log := LoggerProBuilder
.WithMinimumLevel(TLogType.Warning)
.WriteToFile.Done
.Build;
// Change at runtime
(Log as TCustomLogWriter).MinimumLevel := TLogType.Fatal; // Disable almost everythingOption 2: Filtering Provider (Advanced)
uses LoggerPro.Proxy;
var
lAppender: ILogAppender;
lEnabled: Boolean;
lEnabled := True;
lAppender := TLoggerProFileAppender.Create(5, 1000);
// Wrap with runtime filter
lAppender := TLoggerProFilter.Build(
lAppender,
function(const aLogItem: TLogItem): Boolean
begin
Result := lEnabled; // Toggle at runtime
end);
Log := BuildLogWriter([lAppender]);
// Later: disable all logging
lEnabled := False;Send logs to remote syslog servers (RFC 5424):
Log := LoggerProBuilder
.WriteToUDPSyslog
.WithHost('syslog.example.com')
.WithPort(514)
.WithApplication('MyApp')
.WithUseLocalTime(True) // Use local time instead of UTC
.Done
.Build;Send logs to ElasticSearch with authentication support:
// Basic Authentication
Log := LoggerProBuilder
.WriteToElasticSearch
.WithURL('https://elastic.example.com:9200/logs/_doc')
.WithBasicAuth('username', 'password')
.Done
.Build;
// API Key Authentication
Log := LoggerProBuilder
.WriteToElasticSearch
.WithHost('https://elastic.example.com')
.WithPort(9200)
.WithIndex('app-logs')
.WithAPIKey('your-api-key-here')
.Done
.Build;
// Bearer Token Authentication
Log := LoggerProBuilder
.WriteToElasticSearch
.WithURL('https://elastic.example.com:9200/logs/_doc')
.WithBearerToken('your-jwt-token')
.Done
.Build;Get the active log file name from file appenders (useful for uploading, emailing, etc.):
uses LoggerPro.FileAppender;
var
lAppender: TLoggerProSimpleFileAppender;
lFileName: string;
begin
lAppender := TLoggerProSimpleFileAppender.Create;
Log := BuildLogWriter([lAppender]);
Log.Info('Message');
// Get current log file name
lFileName := lAppender.GetCurrentLogFileName;
WriteLn('Logging to: ', lFileName);
// Now you can upload it, email it, etc.
UploadLogFile(lFileName);
end;For TLoggerProFileAppender (separate files per tag):
var
lAppender: TLoggerProFileAppender;
lFileName: string;
lAllFiles: TArray<string>;
begin
lAppender := TLoggerProFileAppender.Create;
// Get file for specific tag
lFileName := lAppender.GetCurrentLogFileName('ORDERS');
// Get all current log files
lAllFiles := lAppender.GetAllCurrentLogFileNames;
end;For complete documentation, tutorials, advanced examples, and best practices:
Add the LoggerPro source folder to your Delphi Library Path.
Search for "LoggerPro" in the Delphinus package manager.
| Platform | Status |
|---|---|
| Windows (32/64-bit) | Full Support |
| Linux | Full Support |
| macOS | Full Support |
| Android | Full Support |
| iOS | Full Support |
| LoggerPro Version | Minimum Delphi Version | Notes |
|---|---|---|
| 2.0.x (current) | Delphi 10.3 Rio | Full compatibility from 10.3+ |
| 1.x (legacy) | Delphi 10 Seattle+ | Legacy support |
Tested on: Delphi 13 Florence, 12 Athens, 11 Alexandria, 10.4 Sydney, 10.3 Rio
Note: LoggerPro 2.0 is fully compatible with Delphi 10.3 Rio and later versions.
The samples/ folder contains 25+ working examples covering every appender and use case. The best way to learn LoggerPro is by exploring these samples.
Apache License 2.0 - Use it freely in personal and commercial projects.
Daniele Teti
- Blog: danieleteti.it
- LoggerPro Docs: danieleteti.it/loggerpro
- Twitter/X: @danieleteti
LoggerPro - Professional Logging for Professional Delphi Developers
