One, log files
A ejabberd node writes two log files:
Ejabberd.log
Ejabberd service logs, messages reported by the Ejabberd node
erlang.log ERLANG/OTP system log, messages reported by ERLANG/OTP using SASL (System architecture Support Library)
Option LogLevel Modify the verbosity of the file Ejabberd.log. The syntax is:
{loglevel, Level}.
The possible level is:
0
No ejabberd log (not recommended)
1 Critical
2 Error
3 Warning
4 Info
5 Debug
For example, the default configuration is:
{loglevel, 4}.
Log files continue to grow, so it is recommended to rotate regularly. To rotate the log files, rename the file and reopen them. The EJABBERDCTL command Reopen-log reopen the log file, and it will automatically rename the old file if you do not rename the old file.
Second, debug the console
The debug console is an Erlang shell that is connected to a running Ejabberd server. With this Erlang shell, an experienced administrator can perform complex tasks.
This shell gives full control of the Ejabberd server, so use it with great care. There are some simple and safe examples of the interconnection of Erlang nodes in the article
To exit this shell, close the window or type: Control+c control+c.
Third, watchdog warning
Ejabberd includes a watchdog watchdog mechanism that can be useful to developers when it comes to identifying issues related to memory usage. If a process on the Ejabberd server consumes more than the configured threshold memory, a message will be sent to the XMPP account defined in the Ejabberd configuration file Option Watchdog_admins.
The syntax is:
{watchdog_admins, [JID, ...]}.
The memory consumed is measured in Word: A word is 4 bytes bytes on a 32-bit system, and 8 bytes bytes on a 64-bit system. The default value for this threshold is 1000000 words. This value can be configured with the option Watchdog_large_heap, or the watchdog alert robot is used in a session.
The syntax is:
{watchdog_large_heap, number}.
Example configuration:
{watchdog_admins, ["[Email protected]", "[email protected]"}.
{watchdog_large_heap, 30000000}.
To remove the watchdog administrator, remove it from the options. In order to remove all watchdog administrators, set this option to an empty list:
{watchdog_admins, []}.
Ejabberd Source Code parsing Prelude--debugging