Logfile Rollover

Hi,

Is there a way to rotate, or get ejabber to create a new log file daily. My current ejabber.log file is more that a GB, and the only way I can see to rotate is to stop ejabber rename the file and start ejabber again.

Thanks
Tiaan

ejabberd has a command to

ejabberd has a command to reopen the log:

ejabberdctl node reopen-log

You just need a tool like lograte that:

  1. Checks for example from time to time the size of the logs.
  2. When it is bigger than a configured size, it will:
  3. archive the logs to something like ejabberd-log-20051104.tar.gz,
  4. delete the current log file,
  5. create a new, empty file,
  6. run the above ejabberdctl command.

--
sander

Logfile Rollover for sasl.log

I've tried the 'ejabberdctl reopen-log' command and it works for the main ejabberd.log file. Is there another command to rotate the sasl.log file? I can't get that one to rotate correctly, ejabberd continues to log to the old file.

There's no command which

There's no command which reopens sasl.log. But it shouldn't grow fast. Ideally it shouln't grow at all. And it would be a good idea to report error (crash) messages from it. Usually they indicate bugs (may be noncritical).

Bummer, I'm using a custom

Bummer, I'm using a custom authentication module that needs to use MD5. It seems that I get tons of crypto_server start and stop messages.

Quote:

=PROGRESS REPORT==== 23-Jun-2006::10:28:29 ===
application: crypto
started_at: 'ejabberd@chat.myserver.com'

=PROGRESS REPORT==== 23-Jun-2006::10:35:21 ===
supervisor: {local,crypto_sup}
started: [{pid,<0.29463.1>},
{name,crypto_server},
{mfa,{crypto_server,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 23-Jun-2006::10:35:21 ===
application: crypto
started_at: 'ejabberd@chat.myserver.com'

I think that comes from this:

Quote:

get_query(User, Password) ->
crypto:start(),
Pass = crypto:md5(Password),
crypto:stop(),
Pas = as_hex(binary_to_list(Pass)),
L = lists:concat([User,"@",Pas]),
Q = as_hex(L),
Q.

So, am I doing anything horribly wrong here? (total Erlang newbie). Or is there anyway to stop crypto_server from logging? I'm getting about 1MB per week in sasl.log.

Simply don't start crypto

Simply don't start crypto server every time. And since it is launched by ejabberd itself you don't have to start it at all.

Thanks, I'll give that a

Thanks, I'll give that a try. I think I put that there when testing from the erl shell outside of ejabberd and needed that to make it work.

Syndicate content