Loading TOC...
Administrator's Guide (PDF)

Administrator's Guide — Chapter 30

Log Files

This chapter describes the log files and includes the following sections:

For information on the audit log files, see Auditing Events.

Application and System Log Files

There are separate log files for application-generated messages and for system-generated messages. This allows for separation of personally identifiable information (such as social security numbers, for example) and system messages (such as merge notices and other system activity). The application log files are configured on a per-App Server basis, and the system log files are configured at the group level. Each host has its own set of log files (both application and system log files). Things like uncaught application errors, which might contain data from an application, are sent to the application logs. Things like MarkLogic Server system activity are sent to the system log files.

Understanding the Log Levels

MarkLogic Server sends log messages to both the operating system log and the MarkLogic Server system file log. Additionally, application log messages (messages generated from application code) are sent to the application logs. Depending on how you configure your logging functions, both operating system and file logs may or may not receive the equivalent number of messages. To enhance performance, the system log should receive fewer messages than the MarkLogic Server file log.

MarkLogic Server uses the following log settings, where Finest is the most verbose while Emergency is the least verbose:

Log Level Description
Finest Extremely detailed debug level messages.
Finer Very detailed debug level messages.
Fine Detailed debug level messages.
Debug Debug level messages.
Config Configuration messages.
Info Informational messages. This is the default setting.
Notice Normal but significant conditions.
Warning Warning conditions.
Error Error conditions.
Critical Critical conditions.
Alert Immediate action required.
Emergency System is unusable.

Log file settings are applied on a per-group basis.

By default, the system log for a group is set to Notice while the file log is set to Info. As such, the system log receives fewer log messages than the file log. You may change these settings to suit your needs. It is more efficient to write to the file log than to the system log. It is good practice to run in production with the Debug file log level to get a more detailed record of operations. Log levels more verbose than Debug may result in very large log files and are not recommended for extended periods of time.

Configuring System Log Files

To configure how log information is generated, perform the following steps:

  1. Click the Groups icon on the left tree menu.
  2. Click the group for which you want to configure the log file settings.
  3. Scroll down to the log settings, towards the bottom of the page.

    The following example shows the default log settings:

  4. Go to System Log Level and change the level if needed.
  5. Go to File Log Level and change the logging level of the MarkLogic Server private log file (ErrorLog.txt) if needed.
  6. Go to Rotate Log Files and select when MarkLogic Server should start a new private log file for this group.

    The following table describes each time frame:

    Time Frame Description
    Never The log file grows without bound.
    Daily A new log file is started every day at 12:00 A.M.
    Sunday A new log file is started every week on Sunday at 12:00 A.M.
    Saturday A new log file is started every week on Saturday at 12:00 A.M.
    Friday A new log file is started every week on Friday at 12:00 A.M.
    Thursday A new log file is started every week on Thursday at 12:00 A.M.
    Wednesday A new log file is started every week on Wednesday at 12:00 A.M.
    Tuesday A new log file is started every week on Tuesday at 12:00 A.M.
    Monday A new log file is started every week on Monday at 12:00 A.M.
    Monthly A new log file is started at 12:00 AM on the first day of each month.
  7. Go to Keep Log Files and enter the number of private log files to keep.

    The private log files are kept in an aging archive. After the number of log files grows to the value specified in the Keep Log File setting, when a new log file is started, the oldest log file archive is automatically deleted.

  8. Scroll to the top or bottom and click OK.

Configuring Application Log Files

To configure how log information is generated for an App Server, perform the following steps:

  1. Click the Groups icon on the left tree menu.
  2. Under App Servers for the group in which the App Server whose application log file settings you want to configure, click the desired App Server.
  3. Scroll down to the log settings, towards the bottom of the page.
  4. Go to File Log Level and change the logging level of the application log file (for example, 8543_ErrorLog.txt for the App Server on port 8543) if needed.
  5. Go to Log Errors and click true if you want uncaught application errors to go to the log file, otherwise click false.
  6. Scroll to the top or bottom and click OK.

    The log rotation of application log files follows the same rules as the system log file for that group, as described in the procedure for Configuring System Log Files.

Viewing the System Log

The system log messages that MarkLogic Server generates are viewable using the standard system log viewing tools available for your platform. On Windows platforms, the seven levels of logging messages are collapsed into three broad categories and the system log messages are registered as MarkLogic. On UNIX platforms, the system logs use the LOG_DAEMON facility, which typically sends system log messages to a file such as /var/log/messages, although this can vary according to the configuration of your system.

Viewing the Application and System File Logs

The private system file log is maintained as a simple text file, and the application logs are also maintained as simple text files. You may view the current or any archived file log at any time using standard text file viewing tools. Additionally, you can access the log files from the Log tab on the main page of the Admin Interface.

The files are stored in the Logs directory under the MarkLogic Server data directory for your platform. You may have overridden the default location for this directory at installation time. The following table lists the default location of the file logs on your platform:

Platform Private Log Files
Microsoft Windows

C:\Program Files\MarkLogic\Data\Logs\ErrorLog.txt

C:\Program Files\MarkLogic\Data\Logs\<port>_ErrorLog.txt

Red Hat Enterprise Linux

/var/opt/MarkLogic/Logs/ErrorLog.txt

/var/opt/MarkLogic/Logs/<port>_ErrorLog.txt

Mac OS X

~/Library/Application Support/MarkLogic/Data/Logs/ErrorLog.txt

~/Library/Application Support/MarkLogic/Data/Logs/<port>_ErrorLog.txt

The application log files are prefixed with the port number of the App Server corresponding the log file. These files contain a set of log messages ordered chronologically. The number of messages depends on the system activity and on the log level that you set. For example, a file log set to Debug would contain many lines of messages whereas a file log set to Emergency would contain the minimum set of messages.

Any trace events are also written to the MarkLogic Server ErrorLog.txt file. Trace events are used to debug applications. You can enable and set trace events in the Admin Interface, on the Diagnostics page for a group. You can also generate your own trace events with the xdmp:trace function.

There must be sufficient disk space on the file system in which the log files reside. If there is no space left on the log file device, MarkLogic Server will abort. Additionally, if there is no disk space available for the log files, MarkLogic Server will fail to start.

Accessing Log Files

MarkLogic Server also produces access log files for each App Server. The access logs are in the NCSA combined log format, and show the requests made against each App Server. The access log files are in the same directory as the ErrorLog.txt logs, and have the port number encoded into their name. For example, the access log files for the Admin Interface is named 8001_AccessLog.txt. You may view the current or any archived file log at any time using standard text file viewing tools. Additionally, you can access the log files from the Log tab on the main page of the Admin Interface. Older versions of the access logs are aged from the system according to the settings configured at the group level, as described in Configuring System Log Files.

« Previous chapter
Next chapter »