Moogsoft Docs

AIOps Component Logs

Moogsoft AIOps components generate log files to report their activity. As a Moogsoft AIOps administrator, you can refer to the logs to audit system usage or diagnose issues. In certain cases you may want to change logging levels based upon your specific environment or needs.

See Logger for information on the Logger Moobot module.

Configure Your Log Files

By default Moogfarmd writes logs into a log file stored in /var/log/moogsoft if you have write permissions for this directory . Otherwise, the logs are written to $MOOGSOFT_HOME/log . The log file takes the name of the HA address of the process. For example, MOO.moog_farmd.farmd_instance1.log.

To save the logs to a different file, run Moogfarmd with this option :

service moogfarmd start --logfilename <filename>

To run the logs on the console only, run Moogfarmd with this option :

service moogfarmd start --logconsole

Log Files by AIOps Component

The following reference provides the information about the log files for the various Moogsoft AIOps components.

Apache Tomcat

Log location: /usr/share/apache-tomcat/logs

Primary log file: catalina.out

To change the logging level for the Moogsoft AIOps servlets which run in Tomcat:

  1. Edit $MOOGSOFT_HOME/config/servlets.conf .
  2. Set the default log level using the top-level loglevel property.

    The available logging levels are ALL , INFO , WARN , DEBUG, and NONE . For example, to enable all logging:

    loglevel: "ALL",
  3. You can optionally override the default log level using the loglevel property specific to the following objects: moogsvr , moogpoller , toolrunner , graze, and events. The available log levels are the same as the default.
  4. Restart Apache Tomcat.

Nginx

Log location: /var/log/nginx

Primary log file: error_log

To change the logging level for Nginx:

  1. Edit /etc/nginx/conf/nginx.conf .
  2. Set the LogLevel property. For example to enable debug logging:

    LogLevel debug
  3. Restart Ngnix.

Integrations (LAMs)

Default log location: /var/log/moogsoft

Some integrations specify other log locations.

Moogfarmd

Log location: /var/log/moogsoft/moogfarmd.log

To change the logging level for Moogfarmd:

  1. Edit /etc/init.d/moogfarmd .
  2. Set the LogLevel property. The available logging levels are ALL , INFO , WARN , DEBUG, and NONE .  For example to enable debug logging:

    LOG_LEVEL=DEBUG
  3. Restart Moogfarmd.

MySQL

Log location: /var/log/mysqld.log

MySQL logging is defaults to the highest level. To remove warning from the MySQL log:

  1. Edit /etc/my.cnf .
  2. Add the following line:

    log_warnings = 0
  3. Restart the mysqld service.

RabbitMQ

Log location: /var/log/rabbitmq

R efer to the RabbitMQ documentation for information on how to configure RabbitMQ.

Elasticsearch

Log location: /var/log/elasticsearch/elasticsearch.log

Refer to the Elasticsearch documentation for information on how to configure Elasticsearch.

Log Rotation for AIOps Components

Moogfarmd and integrations (LAMs) use a Java-based logging utility that automatically runs at startup to prevent log files becoming unmanageably large. The utility also prevents the loss of log data when you restart Moogsoft AIOps.

The utility compresses each rotated log into gzip (.gz) format and appends the filename with a date stamp. Rotated log files are retained for 40 days before they are purged.

The logging utility rotates the logs when the file size reaches 500MB by default. It rotates up to 40 files by default. This is controlled in by two parameters in $MOOGSOFT_HOME/config/system.conf :

file_size

The size limit of the log file in megabytes that triggers a log rotation.

Type : Integer
Default : 500M

maximum_files

The maximum number of files that Moogsoft AIOps can rotate.

Type : Integer
Default : 40

The default logger configuration appears in $MOOGSOFT_HOME/config/system.conf as follows:

"logger":
{
	"file_size" 	: "500M",
	"maximum_files"	: "40"
}