How to create a log file
Kittox includes a pluggable logging system that writes trace data useful for debugging or custom application events. Multiple loggers can be active at once.
Quick setup
Add a Log node to your Config.yaml:
yaml
Log:
Level: 5
TextFile:
FileName: %APP_PATH%log.txt
IsEnabled: TrueThen include the corresponding unit in your UseKitto.pas:
pascal
uses
EF.Logger.TextFile;Log levels
The Level parameter controls the verbosity of log output:
| Level | Description |
|---|---|
1 | Minimal — errors and critical events only |
2 | Warnings |
3 | Informational messages |
4 | Verbose |
5 | Debug — full trace output |
Available loggers
| Logger | Unit | Config section | Description |
|---|---|---|---|
| TextFile | EF.Logger.TextFile | TextFile | Writes to a plain text file |
| CodeSite | EF.Logger.CodeSite | CodeSite | Sends log data to the CodeSite viewer (any edition) |
Each logger section must contain at least IsEnabled: True. You can disable a logger without removing its configuration by setting IsEnabled: False.
Custom loggers
You can create your own loggers by inheriting from TEFLogEndpoint and overriding the DoLog method. Register the class in the initialization section and unregister in the finalization section to make it available to the system.
See Logging for the full reference.
