<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=lYCzn1QolK10N8" style="display:none" height="1" width="1" alt="">

Service Logs

Most of GreenArrow’s services use multilog to log their output to a subdirectory of /var/hvmail/log/.

For example, PostgreSQL logs data to the /var/hvmail/log/postgres/ directory. To tail the PostgreSQL log, run:

tail -F /var/hvmail/log/postgres/current | tai64nlocal

multilog is similar to syslog in that it’s a standard for message logging. There are a few key differences to keep in mind:

  1. Timestamps are recorded using external TAI64 format. You may decode these timestamps using tai64nlocal, as shown in the above tail example. These timestamps appear in both the beginning of each log entry and in the names of most files.

  2. multilog stores the logs for each service within its own directory. Within each service’s directory, the most recently updated log file is named current. Older logs have filenames starting with an external TAI64 format timestamp showing what time that log was last updated.

  3. syslog is normally configured to retain logs for a specific amount of time. multilog, by contrast, gets configured to retain a specific amount of data. For example, multilog could be configured to retain up to 100MB of data for a service.

Log Locations

Service Name Log Location
Bounce Processor /var/hvmail/log/bounce-processor
Config Agent /var/hvmail/log/config-agent
Dynamic Delivery Dispatcher /var/hvmail/log/dd-dispatcher
Dynamic Delivery Log Reader /var/hvmail/log/dd-logreader
Event Processor /var/hvmail/log/event-processor
HTTPD /var/hvmail/log/httpd
Logfile Agent /var/hvmail/log/logfile-agent
Logfile Summary /var/hvmail/log/logfile-summary
Logfile Writer /var/hvmail/log/logfile-writer
Postgres /var/hvmail/log/postgres
Pure Authd - Studio /var/hvmail/log/pure-authd-studio
Pure Authd - FTP /var/hvmail/log/pure-ftpd
Qmail- POP3 /var/hvmail/log/qmail-pop3d
Qmail - SMTPD (port 25) /var/hvmail/log/qmail-smtpd
Qmail - SMTPD2 (default port 587) /var/hvmail/log/qmail-smtpd2
Qmail - SMTPD3 (default port 901) /var/hvmail/log/qmail-smtpd3
Redis /var/hvmail/log/redis
Redis NP /var/hvmail/log/redis-np
RPC /var/hvmail/log/rpc
Rspawn limiter /var/hvmail/log/rspawn-limiter
SimpleMH /var/hvmail/log/simplemh
SimpleMH 2 /var/hvmail/log/simplemh2
SMTP Sink /var/hvmail/log/smtp-sink
Studio Worker /var/hvmail/log/studio-worker

Adjusting Log Retention

The amount of data that multilog retains for most services can be configured by updating the /var/hvmail/control/logconfig.multilog file. Here’s a list of the services can have their log retention configured via this file:

Service Default Retention Service Name in Configuration File
/service/hvmail-bounce-processor 10MB BOUNCE_PROCESSOR
/service/hvmail-config-agent 1MB CONFIG_AGENT
/service/hvmail-dd-dispatcher 1MB DD_DISPATCHER
/service/hvmail-dd-logreader 1MB DD_LOGREADER
/service/hvmail-event-processor 10MB EVENT_PROCESSOR
/service/hvmail-httpd 1MB HTTPD
/service/hvmail-logfile-agent 1MB LOGFILE_AGENT
/service/hvmail-logfile-summary 1MB LOGFILE_SUMMARY
/service/hvmail-logfile-writer 1MB LOGFILE_WRITER
/service/hvmail-postgres 20MB POSTGRES
/service/hvmail-pure-authd-studio 1MB PURE_AUTHD_STUDIO
/service/hvmail-pure-ftpd 1MB PURE_FTPD
/service/hvmail-qmail-pop3d 1MB QMAIL_POP3D
/service/hvmail-qmail-smtpd 10MB QMAIL_SMTPD
/service/hvmail-qmail-smtpd2 10MB QMAIL_SMTPD2
/service/hvmail-qmail-smtpd3 10MB QMAIL_SMTPD3
/service/hvmail-redis 1MB REDIS
/service/hvmail-redis-np 1MB REDIS
/service/hvmail-rpc 1MB RPC
/service/hvmail-rspawn-limiter 1MB RSPAWN_LIMITER
/service/hvmail-simplemh 1MB SIMPLEMH
/service/hvmail-simplemh2 1MB SIMPLEMH
/service/hvmail-smtp-sink 1MB SMTP_SINK
/service/hvmail-studio-worker 1MB STUDIO_WORKER

Adjusting any of the default rention levels listed above is a three step process:

  1. Identify the name that the configuration file uses for the service in the above table. For example, GreenArrow’s PostgreSQL service is named POSTGRES.

  2. Add an entry to the /var/hvmail/control/logconfig.multilog file of the following form:

    POSTGRES='s2097152 n10'
    

    In the above example, POSTGRES is the service name identified in the previous step, s2097152 tells multilog to allow each log file to grow to up to 2,097,152 bytes, or 2MB in size and n10 tells multilog to retain up to 10 of these log files. In other words - retain up to 20MB of PostgreSQL’s output.

  3. Restart the multilog service by using the svc command to apply the change:

    svc -t /service/hvmail-postgres/log/