For additional guidance, check out our community articles detailing the process of migrating from your current platform to Carbonio CE.
For enterprise-level requirements and advanced features, consider checking out Zextras Carbonio – the all-in-one private digital workplace designed for digital sovereignty trusted by the public sector, telcos, and regulated industries.
log4j is a logging framework written in Java, it is also used by Zimbra as the log manager for java processes. In this article, we will take a look at using and configuring log4j for Zimbra, its categories, and outputs.
Zimbra log4j configuration
Zimbra log4j records the log files in the local file system, although it can be modified. The configurations are stored in /opt/zimbra/conf/log4j.properties.in
. There is also another configuration file in /opt/zimbra/conf/log4j
.properties for temporary changes that are overridden by log4j.properties.in
file every time you restart mailboxd service.
To make any changes in the configuration file
- Go to
/opt/zimbra/conf/log4j.properties.in
file. - Make your preferred changes.
- Restart mailboxd service by
zmmailboxdctl restart
For example, this is the default zimbra.sync entry in /opt/zimbra/conf/log4j.properties.in
file
log4j.logger.zimbra.sync=INFO,SYNC
by modifying INFO to TRACE
log4j.logger.zimbra.sync=TRACE,SYNC
the changes will be permanent.
But if for example, you change log settings for a single user via zmprov
zmprov addAccountLogger user@domain.com zimbra.soap debug
with restarting the mailboxd service, the changes are reset since the account-level log settings are temporary and stored in /opt/zimbra/conf/log4j.properties
file.
For more information, you can run these commands
zmprov help log
zmprov help misc
Zimbra log4j categories
To find information on Zimbra log4j categories use
zmprov help log
This is the list of Zimbra log4j categories
zimbra.account | Account operations |
zimbra.acl | ACL operations |
zimbra.backup | Backup and restore |
zimbra.cache | In-memory cache operations |
zimbra.calendar | Calendar operations |
zimbra.dav | DAV operations |
zimbra.dbconn | Database connection tracing |
zimbra.extensions | Server extension loading |
zimbra.ews | EWS operations – ZCS 8.5+ |
zimbra.filter | Mail filtering |
zimbra.gal | GAL operations |
zimbra.imap | IMAP protocol operations |
zimbra.index | Index operations |
zimbra.io | File system operations |
zimbra.ldap | LDAP operations |
zimbra.lmtp | LMTP operations (incoming mail) |
zimbra.mailbox | General mailbox operations |
zimbra.misc | Miscellaneous |
zimbra.op | Changes to the mailbox state |
zimbra.pop | POP protocol operations |
zimbra.redolog | Redo log operations |
zimbra.security | Security events |
zimbra.session | User session tracking |
zimbra.smtp | SMTP operations (outgoing mail) |
zimbra.soap | SOAP protocol |
zimbra.sqltrace | SQL tracing |
zimbra.store | Mail store disk operations |
zimbra.sync | Sync client operations |
zimbra.system | Start-up/shutdown and other system messages |
zimbra.wiki | Wiki operations |
zimbra.zimlet | Zimlet operations |
To facilitate finding problems, it is advised to enable DEBUG level logging of appropriate categories. To do so use
log4j.logger.zimbra.categoryName=DEBUG
For example, to enable DEBUG for the zimbra.mailbox category
log4j.logger.zimbra.mailbox=DEBUG
Zimbra log4j levels
The default logging levels are INFO, WARN, ERROR, and FATAL. You can also turn on the DEBUG or TRACE log levels.
Level | Local | Syslog | SNMP Trap | When Used |
FATAL | Y | Y | Y | Designates very severe error events that the application to abort or impact a large number of users. For example, being unable to contact the MySQL database. |
ERROR | Y | Y | N | Designates error events that might still allow the application to continue running or impact a single user. For example, a single mailbox having a corrupt index or being unable to delete a message from a mailbox. |
WARN | Y | N | N | Designates potentially harmful situations but are usually recoverable or can be ignored. For example, user log in failed. |
INFO* | Y | N | N * | Designates information messages that highlight the progress of the application, basic transaction-level logging. For example, server start-ups, mailbox creation/deletion, account creation. |
DEBUG | Y | N | N | Events that would generally be useful to help a customer debug problems. |
Zimbra log4j output
Log output is stored in the /opt/zimbra/log/mailbox.log file by an appender. It is possible to configure the log4j configuration file in a way that it stores the log output to other predefined or even to user-defined appenders. For example,
log4j.logger.zimbra=INFO, LOGFILE
makes the appender LOGFILE to direct output from the log4j.logger.zimbra
category to be written to /opt/zimbra/log/mailbox.log
. By changing the appender it causes the category to stop writing and to begin writing to the new location. It is also possible to use multiple appenders. For example,
log4j.logger.zimbra=INFO, LOGFILE, SYSLOG
makes log4j.logger.zimbra
category to write logging events to LOGFILE and SYSLOG appenders.