Using log4j to Configure mailboxd Logging: Difference between revisions
Line 14: | Line 14: | ||
To make permanent changes to the configuration file, make changes to '''/opt/zimbra/conf/log4j.properties.in''', and either run '''zmmtaconfig mailboxd''' or restart the server using [[zmcontrol]]. | To make permanent changes to the configuration file, make changes to '''/opt/zimbra/conf/log4j.properties.in''', and either run '''zmmtaconfig mailboxd''' or restart the server using [[zmcontrol]]. | ||
==Commands To Change Logger Options Per Account vs Server== | |||
From ZCS 8.6 : | |||
<pre> | |||
zmprov help log | |||
addAccountLogger(aal) [-s/--server hostname] {name@domain|id} {logging-category} {trace|debug|info|warn|error} | |||
getAccountLoggers(gal) [-s/--server hostname] {name@domain|id} | |||
getAllAccountLoggers(gaal) [-s/--server hostname] | |||
removeAccountLogger(ral) [-s/--server hostname] [{name@domain|id}] [{logging-category}] | |||
resetAllLoggers(rlog) [-s/--server hostname] | |||
Log categories: | |||
zimbra.account - Account operations | |||
zimbra.acl - ACL operations | |||
zimbra.activity - Document operations | |||
zimbra.autoprov - Auto provision operations | |||
zimbra.backup - Backup and restore | |||
zimbra.cache - In-memory cache operations | |||
zimbra.calendar - Calendar operations | |||
zimbra.datasource - Data Source operations | |||
zimbra.dav - DAV operations | |||
zimbra.dbconn - Database connection tracing | |||
zimbra.doc - Docs operations | |||
zimbra.ews - EWS operations | |||
zimbra.extensions - Server extension loading | |||
zimbra.filter - Mail filtering | |||
zimbra.gal - GAL operations | |||
zimbra.im - Instant messaging operations | |||
zimbra.imap - IMAP server | |||
zimbra.imap-client - IMAP client | |||
zimbra.index - Indexing operations | |||
zimbra.io - Filesystem operations | |||
zimbra.ldap - LDAP operations | |||
zimbra.lmtp - LMTP server (incoming mail) | |||
zimbra.mailbox - General mailbox operations | |||
zimbra.mailop - Changes to mailbox state | |||
zimbra.milter - MILTER protocol operations | |||
zimbra.misc - Miscellaneous | |||
zimbra.nginxlookup - Nginx lookup operations | |||
zimbra.pop - POP server | |||
zimbra.pop-client - POP client | |||
zimbra.purge - Mailbox purge operations | |||
zimbra.redolog - Redo log operations | |||
zimbra.search - Search operations | |||
zimbra.security - Security events | |||
zimbra.session - User session tracking | |||
zimbra.smtp - SMTP client (outgoing mail) | |||
zimbra.soap - SOAP protocol | |||
zimbra.sqltrace - SQL tracing | |||
zimbra.store - Mail store disk operations | |||
zimbra.sync - Sync client operations | |||
zimbra.system - Startup/shutdown and other system messages | |||
zimbra.zimlet - Zimlet operations | |||
<pre> | |||
==log4j Categories== | ==log4j Categories== |
Revision as of 21:19, 5 February 2015
Article Information |
---|
This article applies to the following ZCS versions. |
The Zimbra server uses log4j, a Java logging package, as the log manager for mailboxd. By default, the Zimbra server has log4j configured to log to the local file system. You can configure log4j to direct output to a variety of other locations. For more information on log4j, see the Apache log4j documentation.
This article outlines how to use log4j to configure log4j categories, log output, logging levels.
Note: This article is only relevant to logging for mailboxd. For information on other Zimbra log files, see Log Files.
log4j Configuration File
Errors, warnings and other logging events are logged by category. For example, an IMAP error will be logged to the log4j.logger.zimbra.imap sub-category.
The category settings in log4j are stored in a configuration file. This file is located at /opt/zimbra/conf/log4j.properties. To configure logging output and logging levels, you must change a category in the log4j configuration file. Bug 75505 In 7.x and earlier releases, the server side logging controlled in log4j.properties was automatically scanned and reloaded even when the server is running. In 8.0 it is now necessary to invoke zmprov rlog from the command line in order to cause log4j.properties to be reloaded while server is running.
To make permanent changes to the configuration file, make changes to /opt/zimbra/conf/log4j.properties.in, and either run zmmtaconfig mailboxd or restart the server using zmcontrol.
Commands To Change Logger Options Per Account vs Server
From ZCS 8.6 :
zmprov help log addAccountLogger(aal) [-s/--server hostname] {name@domain|id} {logging-category} {trace|debug|info|warn|error} getAccountLoggers(gal) [-s/--server hostname] {name@domain|id} getAllAccountLoggers(gaal) [-s/--server hostname] removeAccountLogger(ral) [-s/--server hostname] [{name@domain|id}] [{logging-category}] resetAllLoggers(rlog) [-s/--server hostname] Log categories: zimbra.account - Account operations zimbra.acl - ACL operations zimbra.activity - Document operations zimbra.autoprov - Auto provision operations zimbra.backup - Backup and restore zimbra.cache - In-memory cache operations zimbra.calendar - Calendar operations zimbra.datasource - Data Source operations zimbra.dav - DAV operations zimbra.dbconn - Database connection tracing zimbra.doc - Docs operations zimbra.ews - EWS operations zimbra.extensions - Server extension loading zimbra.filter - Mail filtering zimbra.gal - GAL operations zimbra.im - Instant messaging operations zimbra.imap - IMAP server zimbra.imap-client - IMAP client zimbra.index - Indexing operations zimbra.io - Filesystem operations zimbra.ldap - LDAP operations zimbra.lmtp - LMTP server (incoming mail) zimbra.mailbox - General mailbox operations zimbra.mailop - Changes to mailbox state zimbra.milter - MILTER protocol operations zimbra.misc - Miscellaneous zimbra.nginxlookup - Nginx lookup operations zimbra.pop - POP server zimbra.pop-client - POP client zimbra.purge - Mailbox purge operations zimbra.redolog - Redo log operations zimbra.search - Search operations zimbra.security - Security events zimbra.session - User session tracking zimbra.smtp - SMTP client (outgoing mail) zimbra.soap - SOAP protocol zimbra.sqltrace - SQL tracing zimbra.store - Mail store disk operations zimbra.sync - Sync client operations zimbra.system - Startup/shutdown and other system messages zimbra.zimlet - Zimlet operationslog4j Categories
Enabling DEBUG in the appropriate sub-category can help you identify a problem. If you do not know what sub-category to enable, you can enable DEBUG in log4j.logger.zimbra, however this will generate logging events for every single subcategory. This is a very large amount of logging events and can take a long time to read through. For this reason, it is always advisable to enable DEBUG or another logging level in a specific sub-category. To enable logging for a specific category, add the following to the end of the log4j configuration file: log4j.logger.zimbra.<category name>=DEBUG For example, the following enables DEBUG level logging for the zimbra.mailbox category: log4j.logger.zimbra.mailbox=DEBUG Note: Review the configuration file to see if the category you are enabling is already listed. If a category is listed twice, and both instances have the same appender, it will log each event twice.Predefined log4j Categories in ZCS
The following table contains a list of log4j categories which are predefined in the Zimbra Collaboration Suite. Note: You can also find information on predefined log4j categories in zmprov help log.
Category | Description |
---|---|
log4j.logger.zimbra | Parent logger category. Records log events for all of the following child categories. By default, this category is set to the INFO log level. |
Sub-categories of log4j.logger.zimbra | Description |
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 |