24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-04 21:27:16 +02:00

* doc/guide.tex: Updated the names of log files.

* doc/guide.html: Likewise

* src/mod_muc/mod_muc_room.erl: Added log messages for room
destroy

* src/mod_caps.erl: Small beautify of log error messages

SVN Revision: 1156
This commit is contained in:
Badlop 2008-01-16 10:16:14 +00:00
parent 21f9c7e2d2
commit 50f0c3a14b
5 changed files with 33 additions and 17 deletions

View File

@ -1,3 +1,13 @@
2008-01-16 Badlop <badlop@process-one.net>
* doc/guide.tex: Updated the names of log files.
* doc/guide.html: Likewise
* src/mod_muc/mod_muc_room.erl: Added log messages for room
destroy
* src/mod_caps.erl: Small beautify of log error messages
2008-01-15 Badlop <badlop@process-one.net> 2008-01-15 Badlop <badlop@process-one.net>
* doc/guide.tex: Improved the documentation of Binary * doc/guide.tex: Improved the documentation of Binary

View File

@ -383,7 +383,7 @@ To get the full list run the command:
</DD><DT CLASS="dt-description"><B><TT>/var/lib/ejabberd/</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>/var/lib/ejabberd/</TT></B></DT><DD CLASS="dd-description">
<DL CLASS="description"><DT CLASS="dt-description"> <DL CLASS="description"><DT CLASS="dt-description">
<B><TT>.erlang.cookie</TT></B></DT><DD CLASS="dd-description"> Erlang cookie file <B><TT>.erlang.cookie</TT></B></DT><DD CLASS="dd-description"> Erlang cookie file
</DD><DT CLASS="dt-description"><B><TT>db</TT></B></DT><DD CLASS="dd-description"> Database spool files </DD><DT CLASS="dt-description"><B><TT>db</TT></B></DT><DD CLASS="dd-description"> Mnesia database spool files
</DD><DT CLASS="dt-description"><B><TT>ebin</TT></B></DT><DD CLASS="dd-description"> Binary Erlang files (*.beam) </DD><DT CLASS="dt-description"><B><TT>ebin</TT></B></DT><DD CLASS="dd-description"> Binary Erlang files (*.beam)
</DD><DT CLASS="dt-description"><B><TT>priv</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>priv</TT></B></DT><DD CLASS="dd-description">
<DL CLASS="description"><DT CLASS="dt-description"> <DL CLASS="description"><DT CLASS="dt-description">
@ -393,8 +393,8 @@ To get the full list run the command:
</DD></DL> </DD></DL>
</DD><DT CLASS="dt-description"><B><TT>/var/log/ejabberd/</TT></B></DT><DD CLASS="dd-description"> Log files (see section&#XA0;<A HREF="#logfiles">7.2</A>): </DD><DT CLASS="dt-description"><B><TT>/var/log/ejabberd/</TT></B></DT><DD CLASS="dd-description"> Log files (see section&#XA0;<A HREF="#logfiles">7.2</A>):
<DL CLASS="description"><DT CLASS="dt-description"> <DL CLASS="description"><DT CLASS="dt-description">
<B><TT>ejabberd.log</TT></B></DT><DD CLASS="dd-description"> Messages reported by ejabberd code <B><TT>ejabberd.log</TT></B></DT><DD CLASS="dd-description"> ejabberd service log
</DD><DT CLASS="dt-description"><B><TT>sasl.log</TT></B></DT><DD CLASS="dd-description"> Messages reported by Erlang/OTP </DD><DT CLASS="dt-description"><B><TT>sasl.log</TT></B></DT><DD CLASS="dd-description"> Erlang/OTP system log
</DD></DL> </DD></DL>
</DD></DL><!--TOC subsection Start--> </DD></DL><!--TOC subsection Start-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc13">2.4.5</A>&#XA0;&#XA0;Start</H3><!--SEC END --><P> <H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc13">2.4.5</A>&#XA0;&#XA0;Start</H3><!--SEC END --><P>
@ -2706,7 +2706,7 @@ all the environment variables and command line parameters.</P><P>The environment
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_MSGS_PATH</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>EJABBERD_MSGS_PATH</TT></B></DT><DD CLASS="dd-description">
Path to the directory with translated strings. Path to the directory with translated strings.
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_LOG_PATH</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>EJABBERD_LOG_PATH</TT></B></DT><DD CLASS="dd-description">
Path to the ejabberd log file. Path to the ejabberd service log file.
</DD><DT CLASS="dt-description"><B><TT>EJABBERD_SO_PATH</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>EJABBERD_SO_PATH</TT></B></DT><DD CLASS="dd-description">
Path to the directory with binary system libraries. Path to the directory with binary system libraries.
</DD><DT CLASS="dt-description"><B><TT>HOME</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>HOME</TT></B></DT><DD CLASS="dd-description">
@ -2744,7 +2744,7 @@ Starts the Erlang system detached from the system console.
</DD><DT CLASS="dt-description"><B><TT>-mnesia dir "/var/lib/ejabberd/db/nodename"</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>-mnesia dir "/var/lib/ejabberd/db/nodename"</TT></B></DT><DD CLASS="dd-description">
Specify the Mnesia database directory. Specify the Mnesia database directory.
</DD><DT CLASS="dt-description"><B><TT>-sasl sasl_error_logger {file, "/var/log/ejabberd/sasl.log"}</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>-sasl sasl_error_logger {file, "/var/log/ejabberd/sasl.log"}</TT></B></DT><DD CLASS="dd-description">
Specify the directory for the sasl.log file. Path to the Erlang/OTP system log file.
</DD><DT CLASS="dt-description"><B><TT>+K [true|false]</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>+K [true|false]</TT></B></DT><DD CLASS="dd-description">
Kernel polling. Kernel polling.
</DD><DT CLASS="dt-description"><B><TT>-smp [auto|enable|disable]</TT></B></DT><DD CLASS="dd-description"> </DD><DT CLASS="dt-description"><B><TT>-smp [auto|enable|disable]</TT></B></DT><DD CLASS="dd-description">

View File

@ -337,7 +337,7 @@ The files and directories created are, by default:
\titem{/var/lib/ejabberd/} \titem{/var/lib/ejabberd/}
\begin{description} \begin{description}
\titem{.erlang.cookie} Erlang cookie file \titem{.erlang.cookie} Erlang cookie file
\titem{db} Database spool files \titem{db} Mnesia database spool files
\titem{ebin} Binary Erlang files (*.beam) \titem{ebin} Binary Erlang files (*.beam)
\titem{priv} \titem{priv}
\begin{description} \begin{description}
@ -347,8 +347,8 @@ The files and directories created are, by default:
\end{description} \end{description}
\titem{/var/log/ejabberd/} Log files (see section~\ref{logfiles}): \titem{/var/log/ejabberd/} Log files (see section~\ref{logfiles}):
\begin{description} \begin{description}
\titem{ejabberd.log} Messages reported by ejabberd code \titem{ejabberd.log} ejabberd service log
\titem{sasl.log} Messages reported by Erlang/OTP \titem{sasl.log} Erlang/OTP system log
\end{description} \end{description}
\end{description} \end{description}
@ -3360,7 +3360,7 @@ The environment variables:
\titem{EJABBERD\_MSGS\_PATH} \titem{EJABBERD\_MSGS\_PATH}
Path to the directory with translated strings. Path to the directory with translated strings.
\titem{EJABBERD\_LOG\_PATH} \titem{EJABBERD\_LOG\_PATH}
Path to the ejabberd log file. Path to the ejabberd service log file.
\titem{EJABBERD\_SO\_PATH} \titem{EJABBERD\_SO\_PATH}
Path to the directory with binary system libraries. Path to the directory with binary system libraries.
\titem{HOME} \titem{HOME}
@ -3400,7 +3400,7 @@ The command line parameters:
\titem{-mnesia dir "/var/lib/ejabberd/db/nodename"} \titem{-mnesia dir "/var/lib/ejabberd/db/nodename"}
Specify the Mnesia database directory. Specify the Mnesia database directory.
\titem{-sasl sasl\_error\_logger \{file, "/var/log/ejabberd/sasl.log"\}} \titem{-sasl sasl\_error\_logger \{file, "/var/log/ejabberd/sasl.log"\}}
Specify the directory for the sasl.log file. Path to the Erlang/OTP system log file.
\titem{+K [true|false]} \titem{+K [true|false]}
Kernel polling. Kernel polling.
\titem{-smp [auto|enable|disable]} \titem{-smp [auto|enable|disable]}
@ -3834,14 +3834,14 @@ Example configuration:
\section{Log Files} \section{Log Files}
\label{logfiles} \label{logfiles}
\ejabberd{} writes messages in two log files: An \ejabberd{} node writes two log files:
\begin{description} \begin{description}
\titem{ejabberd.log} Messages reported by \ejabberd{} code \titem{ejabberd.log} is the ejabberd service log, with the messages reported by \ejabberd{} code
\titem{sasl.log} Messages reported by Erlang/OTP using SASL (System Architecture Support Libraries) \titem{sasl.log} is the Erlang/OTP system log, with the messages reported by Erlang/OTP using SASL (System Architecture Support Libraries)
\end{description} \end{description}
The option \term{loglevel} modifies the verbosity of the file ejabberd.log. The option \term{loglevel} modifies the verbosity of the file ejabberd.log.
There possible levels are: The possible levels are:
\begin{description} \begin{description}
\titem{0} No ejabberd log at all (not recommended) \titem{0} No ejabberd log at all (not recommended)
\titem{1} Critical \titem{1} Critical

View File

@ -252,9 +252,9 @@ handle_cast({disco_response, From, _To,
end; end;
{error, _} -> {error, _} ->
gen_server:cast(self(), visit_feature_queries), gen_server:cast(self(), visit_feature_queries),
?ERROR_MSG("Error IQ reponse IQ from ~s: ~p", [jlib:jid_to_string(From), SubEls]); ?ERROR_MSG("Error IQ reponse IQ from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
{result, _} -> {result, _} ->
?ERROR_MSG("Invalid IQ contents from ~s: ~p", [jlib:jid_to_string(From), SubEls]); ?ERROR_MSG("Invalid IQ contents from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
_ -> _ ->
%% Can't do anything about errors %% Can't do anything about errors
ok ok

View File

@ -612,8 +612,12 @@ handle_event({destroy, Reason}, _StateName, StateData) ->
[{xmlelement, "reason", [{xmlelement, "reason",
[], [{xmlcdata, Reason}]}] [], [{xmlcdata, Reason}]}]
end}, StateData), end}, StateData),
?INFO_MSG("Destroyed MUC room ~s with reason: ~p",
[jlib:jid_to_string(StateData#state.jid), Reason]),
{stop, normal, StateData}; {stop, normal, StateData};
handle_event(destroy, StateName, StateData) -> handle_event(destroy, StateName, StateData) ->
?INFO_MSG("Destroyed MUC room ~s",
[jlib:jid_to_string(StateData#state.jid)]),
handle_event({destroy, none}, StateName, StateData); handle_event({destroy, none}, StateName, StateData);
handle_event({set_affiliations, Affiliations}, StateName, StateData) -> handle_event({set_affiliations, Affiliations}, StateName, StateData) ->
@ -938,6 +942,8 @@ process_presence(From, Nick, {xmlelement, "presence", Attrs, _Els} = Packet,
case (not (StateData1#state.config)#config.persistent) andalso case (not (StateData1#state.config)#config.persistent) andalso
(?DICT:to_list(StateData1#state.users) == []) of (?DICT:to_list(StateData1#state.users) == []) of
true -> true ->
?INFO_MSG("Destroyed MUC room ~s because it's temporary and empty",
[jlib:jid_to_string(StateData#state.jid)]),
{stop, normal, StateData1}; {stop, normal, StateData1};
_ -> _ ->
{next_state, normal_state, StateData1} {next_state, normal_state, StateData1}
@ -2396,7 +2402,7 @@ process_iq_owner(From, set, Lang, SubEl, StateData) ->
{error, ?ERR_BAD_REQUEST} {error, ?ERR_BAD_REQUEST}
end; end;
[{xmlelement, "destroy", _Attrs1, _Els1} = SubEl1] -> [{xmlelement, "destroy", _Attrs1, _Els1} = SubEl1] ->
?INFO_MSG("Destroyed MUC room ~s by ~s", ?INFO_MSG("Destroyed MUC room ~s by the owner ~s",
[jlib:jid_to_string(StateData#state.jid), jlib:jid_to_string(From)]), [jlib:jid_to_string(StateData#state.jid), jlib:jid_to_string(From)]),
destroy_room(SubEl1, StateData); destroy_room(SubEl1, StateData);
Items -> Items ->