log_rotate_size: 0
log_rotate_date: ""
...
No errors
I want to disable ejabberd's internal log rotation. I found documentation saying I should set log_rotate_size to 0 [1], however that does not seem to work. If I do that ejabberd no longer starts (with no errors in the logs or on the command line).
[1] https://www.ejabberd.im/forum/28718/ejabberdyml-configuration/index.html
The up to date docs are here
https://docs.ejabberd.im/admin/configuration/toplevel/#log-rotate-size
But these docs don't mention how to disable logrotate at all.
Has this possibility been removed? That seems odd.
You can use 'infinity' here to disable logrotation on size
This should probably be added to the documentation.
(I'd still consider it a bug if ejabberd simply does not start without giving any hint what's going on.)
I found documentation saying I should set log_rotate_size to 0 [1],
A forum post three years old that is read-only... I wouldn't call that "documentation", considering that there exists a site like http://docs.ejabberd.im/
however that does not seem to work.
Thanks for reporting, I've updated https://docs.ejabberd.im/admin/configuration/toplevel/#log-rotate-size now it's better explained:
pos_integer() | infinity
The size (in bytes) of a log file to trigger rotation.
If set to infinity, log rotation is disabled.
The default value is 10485760 (that is, 10 Mb).
If I do that ejabberd no longer starts (with no errors in the logs or on the command line).
Right, ejabberd doesn't report the error in the log file... because the log file is incorrectly configured.
The error message is produced, but can only be seen when using interactive shell, no log:
$ ejabberdctl live
Erlang/OTP 23 [erts-11.1.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1]
Eshell V11.1.4 (abort with ^G)
(ejabberd@localhost)1> 2021-01-04 12:58:07.284612+01:00 [critical] Failed to set logging: {error,
{handler_not_added,
{invalid_config,logger_std_h,
#{max_no_bytes => 0}}}}
2021-01-04 12:58:07.484096+01:00 [info] Loading configuration from /etc/ejabberd/ejabberd.yml
2021-01-04 12:58:07.559850+01:00 [critical] Failed to start ejabberd application:
Invalid value of option log_rotate_size: Expected positive integer or 'infinity', got: 0
Sorry to bother again, but it seems the "infinity" setting, while not preventing ejabberd from starting, does not do anything.
I'm still getting ejabberd.log.0 files every few days. Shall I open a separate bug?
I can confirm that, those options are handled a bit different than rest (logging options are required early in startup process, before config file is loaded), there is preprocess step that supplies them as command arguments, and looks like it have problem with value infinity. I will prepare fix for that.
I added 95c157409b1e6cf82a5dc40c23de91624d495d9d that should fix this issue.