Log Service Overview
AXIGEN offers an extremely flexible logging service, allowing you to select among different logging levels (how detailed the information logged should be), logging types (internal, external and system services are available) and where to store the information logged. You can set all these options for each AXIGEN TCP service and for the Log Service itself.The Log Service is responsible with collecting events relevant for the System Administrator.
You can log (internally, remotely or using the system log) the activity of all services available in AXIGEN.
AXIGEN Log Service can log internal data coming from other AXIGEN modules/services or data coming from the UDP port 2000 (default option). This data can be logged in the same location or in different locations for separate services, depending on the configuration applied by the system administrator.
For AXIGEN Log service, you can also specify the following information:
- on what address the Log listener should be listening (see the Log Listener section for more information);
- what hosts should be rejected by the Log service (using the listener denyRules, a priority and an enable/disable switch);
- what hosts should be accepted by the Log service (using the listener allowRules, a priority and an enable/disable switch).
Log Types
AXIGEN modules should define the log type using the "logtype" parameter, which can have any single values from the following three:- "internal",
- "remote" or
- "system" log.
Use the "internal" option to send events to the Log Service running on the same AXIGEN server. The Server should have the Log Service activated.
Use the "remote" option to send events to a Log Service running in another AXIGEN server, remotely, at the address specified using the "hostname" attribute. This AXIGEN Server must have the Log Service activated.
Use the "system" option to send events to the syslog (for instance sysklogd) with facility "LOG_MAIL" and levels mapped as:
- 0 - no message sent
- 1 - LOG_CRIT
- 2 - LOG_ERR
- 4 - LOG_WARNING
- 8 - LOG_INFO
- 16 - LOG_DEBUG
AXIGEN Log levels
In AXIGEN the events are organized in 6 categories and you can select which category of events to collect. AXIGEN modules must define the "loglevel" parameter. In order to specify the desired sets of events to log you have to specify the correspondent log levels or a combination of thereof. The log levels in AXIGEN Mail Server are:- 0: no messages are logged
- 1: log critical messages
- 2: log errors
- 4: log warnings
- 8: log informative messages
- 16: log protocol communication
Example 1 - Combining log levels in AXIGEN Mail Server:
If you set
loglevel=15 = 1+2+4+8
AXIGEN Mail Server will log the following information: critical errors and errors and warnings and information.
Example 2 Disabling the log service for one AXIGEN service
Remember the log service is configured separately for AXIGEN Mail Server main services (IMAP, POP3, SMTP Incoming), so if you set loglevel = 0
in the IMAP log service section, no data for that specific service will be logged by the Log Server for the AXIGEN IMAP service. However, the Log server will continue logging other AXIGEN Mail Server services according to the settings defined for logging the respective services.
Logging format
The format used for data logging is the following:'date hostname modulename:sessionId: user_message\n'
AXIGEN Log service then transforms this data in a format similar to the one described below:
'date loglevel hostname modulename:sessionId: user_message\n'
05-19 17:08:01 0300 08 johnd-l SMTP:00000005: connection accepted from [127.0.0.1]
Example of log service configuration using the axigen.cfg file:
- loglevel = 01-31
- hostname = 'yourcompany.com' (this is the result of the standard 'hostname' command)
- modulename = 'SMTP' (other accepted values are: POP3, IMAP, WEBMAIL, RELAY, PROCESSING)
- sessionId (this is an UINT value written in hexa incremented separately for each connection of a protocol. For the processing module, as there is no relevant protocol, the value is currently 0; future versions will provide however as value the ID of the message in the working queue.
- loglevel is a 5 bits mask for the following values:
/// critical
LOG_crit = 0x01,
/// errors
LOG_err = 0x02,
/// warnings
LOG_warn = 0x04,
/// information
LOG_info = 0x08,
/// log protocol communication
LOG_proto = 0x10,
Rules
Log Rules are used to define circumstances under which certain restrictions will be imposed on log files and the log level. Rules can be associated with host names, module names or both. For instance, a rule can be defined in order to specify the size, duration and number of old files kept for logs generated on a certain host, for a certain module (e.g. SMTP In).An ordered list is created with all log rules configurations using the 'priority' parameters as ordering key.
You can define the Log rules at the AXIGEN main module's level, in the corresponding sections of the configuration file.
The Log Service will check if the information sent by the modules is the information that is supposed to receive, according to the Log Service configuration.
A log rule set includes the following information:
- the rule's priority ("1" means the rule has the highest priority possible)
- the hostname of the user of this rule
- the module of the user of this rule
- the level of log generated by the user of this log
- the name of the destination file
- the maximum size of the destination file in KB
- the maximum duration the destination file is used in seconds
- the maximum number of old files (saved) to be kept
- the rotate period (how often a new log file is created - daily, monthly, yearly)
Attributes of the Log service
AXIGEN Log service can log internal data coming from other modules/services or data coming from the UDP port 2000 (default value). This data can be logged in the same location or in different locations for separate services, depending on the configuration applied by system administrator.AXIGEN main modules must define the log type to be used by that specific module. The definition is executed via the "logtype" parameter that can have any of the following three values: "internal", "remote" or "system" log.
The value for the loglevel parameter from the log clients (the services sending information for logging to AXIGEN Log service) specifies for themselves the log levels sent to the Log service.
The value for the loglevel parameter from the log service's rule specifies the log levels accepted by the service from clients.
Therefore if:
- clientlevel = 15 (the log level specified in the SMTP-In service page in WebAdmin for instance)
- rulelevel = 9 (the log level specified in the rule defined for the SMTP-In module)
For information on how to configure log rules using WebAdmin, see the Adding and Editing Log Rules.










