We will start from the project created in the first recipe, take that project and clone it in your file system; this will be the starting point.
The goal is to write a log mechanism that does the following:
- Writes all Log levels to file and through the SysLog protocol
- Sends emails in case of error
Perform the following steps:
- First, we have to define a configuration file called LoggerProConfig.pas. In this file, we define the appenders, the log level, and we provide a log interface that's ready for use:
unit LoggerProConfig;interfaceuses LoggerPro;const LOG_TAG = 'PHONEBOOK_SERVER';function Log: ILogWriter;implementationuses LoggerPro.FileAppender, LoggerPro.EMailAppender, LoggerPro.OutputDebugStringAppender, LoggerPro.UDPSyslogAppender, ...