[LOGBack-dev] svn commit: r587 - in logback/trunk: logback-classic/src/main/java/ch/qos/logback/classic/net logback-core/src/main/java/ch/qos/logback/core/net logback-core/src/main/java/ch/qos/logback/core/rolling logback-site/src/site/fml
noreply.seb at qos.ch
noreply.seb at qos.ch
Thu Sep 14 18:24:47 CEST 2006
Author: seb
Date: Thu Sep 14 18:24:46 2006
New Revision: 587
Modified:
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java
logback/trunk/logback-site/src/site/fml/codes.fml
Log:
- updated codes.html page
- updated a few classes' addError calls to display a link to the codes.html page
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/net/SocketAppender.java Thu Sep 14 18:24:46 2006
@@ -164,12 +164,12 @@
int errorCount = 0;
if (port == 0) {
errorCount++;
- addError("No port was configured for appender" + name);
+ addError("No port was configured for appender" + name + " For more information, please visit http://logback.qos.ch/codes.html#socket_no_port");
}
if (address == null) {
errorCount++;
- addError("No remote address was configured for appender" + name);
+ addError("No remote address was configured for appender" + name + " For more information, please visit http://logback.qos.ch/codes.html#socket_no_host");
}
connect(address, port);
@@ -242,7 +242,7 @@
if (address == null) {
addError("No remote host is set for SocketAppender named \"" + this.name
- + "\".");
+ + "\". For more information, please visit http://logback.qos.ch/codes.html#socket_no_host");
return;
}
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java Thu Sep 14 18:24:46 2006
@@ -133,7 +133,7 @@
}
if (this.layout == null) {
- addError("No layout set for appender named [" + name + "].");
+ addError("No layout set for appender named [" + name + "]. For more information, please visit http://logback.qos.ch/codes.html#smtp_no_layout");
return false;
}
return true;
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java Thu Sep 14 18:24:46 2006
@@ -75,7 +75,7 @@
return Long.valueOf(s).longValue() * multiplier;
}
catch (NumberFormatException e) {
- addError("[" + s + "] is not in proper int form.");
+ addError("[" + s + "] is not in proper int form. For more info, please visit http://logback.qos.ch/codes.html#sbtp_size_format");
addError("[" + value + "] not in expected format.", e);
}
}
Modified: logback/trunk/logback-site/src/site/fml/codes.fml
==============================================================================
--- logback/trunk/logback-site/src/site/fml/codes.fml (original)
+++ logback/trunk/logback-site/src/site/fml/codes.fml Thu Sep 14 18:24:46 2006
@@ -1,30 +1,183 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<document>
- <body>
+ <body>
- <faqs title="Logback error messages and their meanings">
-
- <part id="Generalities">
- <title>Generalities</title>
-
- <faq id="tbr_fnp_not_set">
-
- <question>The <b>FileNamePattern</b> option must be set before
- using <code>TimeBasedRollingPolicy</code> or
- <code>FixedWindowRollingPolicy</code>.
- </question>
-
- <answer>
- <p>The <b>FileNamePattern</b> option for both
- <code>TimeBasedRollingPolicy</code> and
- <code>FixedWindowRollingPolicy</code> is mandatory.
- </p>
- </answer>
-
- </faq>
- </part>
- </faqs>
- </body>
+ <faqs title="Logback error messages and their meanings">
+ <part id="Generalities">
+ <title>Generalities</title>
+
+ <faq id="tbr_fnp_not_set">
+
+ <question>
+ The
+ <b>FileNamePattern</b>
+ option must be set before using
+ <code>TimeBasedRollingPolicy</code>
+ or
+ <code>FixedWindowRollingPolicy</code>
+ .
+ </question>
+
+ <answer>
+ <p>
+ The
+ <b>FileNamePattern</b>
+ option for both
+ <code>TimeBasedRollingPolicy</code>
+ and
+ <code>FixedWindowRollingPolicy</code>
+ is mandatory.
+ </p>
+ </answer>
+
+ </faq>
+ <faq id="socket_no_host">
+ <question>
+ No remote host or address is set for
+ <code>SocketAppender</code>
+ .
+ </question>
+
+ <answer>
+ <p>
+ A remote host or address is mandatory for
+ SocketAppender.
+ </p>
+ <p>
+ You can specify the remote host in the
+ configuration file like this:
+ </p>
+ <pre>
+<appender name="SOCKET" class="ch.qos.logback.classic.net.SocketAppender">
+ ...
+ <param name="remoteHost" value="127.0.0.1" />
+ ...
+</appender>
+ </pre>
+ </answer>
+ </faq>
+ <faq id="socket_no_port">
+ <question>
+ No remote port is set for
+ <code>SocketAppender</code>
+ .
+ </question>
+
+ <answer>
+ <p>
+ A remote port is mandatory for
+ SocketAppender.
+ </p>
+ <p>
+ You can specify the remote port in the
+ configuration file like this:
+ </p>
+ <pre>
+<appender name="SOCKET" class="ch.qos.logback.classic.net.SocketAppender">
+ ...
+ <param name="port" value="4560" />
+ ...
+</appender>
+ </pre>
+ </answer>
+ </faq>
+ <faq id="smtp_no_tp">
+ <question>
+ No
+ <code>TriggeringPolicy</code>
+ is set for appender
+ </question>
+
+ <answer>
+ <p>
+ A
+ <code>TriggeringPolicy</code>
+ is mandatory for
+ <code>SMTPAppender</code>
+ . It allows the appender to know when to
+ send the email to the specified address.
+ </p>
+ <p>
+ You can specify the
+ <code>TriggeringPolicy</code>
+ in the configuration file like this:
+ </p>
+ <pre>
+<appender name="SOCKET" class="ch.qos.logback.classic.net.SocketAppender">
+ ...
+ <param name="port" value="4560"/>
+ ...
+</appender>
+ </pre>
+ </answer>
+ </faq>
+ <faq id="smtp_no_layout">
+ <question>
+ No
+ <code>Layout</code>
+ is set for appender
+ </question>
+
+ <answer>
+ <p>
+ A
+ <code>Layout</code>
+ is mandatory for
+ <code>SMTPAppender</code>
+ . It allows the appender format the logging
+ events before sending the email. Two layouts
+ are often used with
+ <code>SMTPAppender</code>
+ :
+ <code>PatternLayout</code>
+ and
+ <code>HTMLLayout</code>
+ .
+ </p>
+ <p>
+ You can specify the
+ <code>Layout</code>
+ in the configuration file like this:
+ </p>
+ <pre>
+<appender name="SMTP" class="ch.qos.logback.classic.net.SMTPAppender">
+ ...
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <param name="pattern" value="%-4relative [%thread] %-5level %class - %msg%n" />
+ </layout>
+ ...
+</appender>
+ </pre>
+ </answer>
+ </faq>
+ <faq id="sbtp_size_format">
+ <question>
+ Specified number is not in proper int form, or
+ not expected format.
+ </question>
+
+ <answer>
+ <p>
+ When you specify the MaxFileSize to be used
+ by the SizeBasedRollingPolicy, logback
+ expects a rather precise format:
+ </p>
+ <ul>
+ <li>The number has to be an integer</li>
+ <li>
+ You can add 'KB', 'MB' or 'GB' after the
+ number.
+ </li>
+ </ul>
+ <p>
+ Here are some correct values: 500KB, 15MB,
+ 2GB.
+ </p>
+ </answer>
+ </faq>
+ </part>
+ </faqs>
+ </body>
</document>
More information about the logback-dev
mailing list