View | Details | Raw Unified | Return to bug 40500
Collapse All | Expand All

(-)src/org/apache/taglibs/log/DebugTag.java (+4 lines)
Lines 33-37 Link Here
33
    protected void log(Log logCategory, String message) {
33
    protected void log(Log logCategory, String message) {
34
        logCategory.debug(message);
34
        logCategory.debug(message);
35
    }
35
    }
36
37
    protected void log(Log logCategory, String message, Throwable t) {
38
        logCategory.debug(message,t);
39
    }
36
}
40
}
37
41
(-)src/org/apache/taglibs/log/ErrorTag.java (+4 lines)
Lines 33-37 Link Here
33
    protected void log(Log logCategory, String message) {
33
    protected void log(Log logCategory, String message) {
34
        logCategory.error(message);
34
        logCategory.error(message);
35
    }
35
    }
36
37
    protected void log(Log logCategory, String message, Throwable t) {
38
        logCategory.error(message,t);
39
    }
36
}
40
}
37
41
(-)src/org/apache/taglibs/log/FatalTag.java (+4 lines)
Lines 33-37 Link Here
33
    protected void log(Log logCategory, String message) {
33
    protected void log(Log logCategory, String message) {
34
        logCategory.fatal(message);
34
        logCategory.fatal(message);
35
    }
35
    }
36
37
    protected void log(Log logCategory, String message, Throwable t) {
38
        logCategory.fatal(message,t);
39
    }
36
}
40
}
37
41
(-)src/org/apache/taglibs/log/InfoTag.java (+4 lines)
Lines 33-37 Link Here
33
    protected void log(Log logCategory, String message) {
33
    protected void log(Log logCategory, String message) {
34
        logCategory.info(message);
34
        logCategory.info(message);
35
    }
35
    }
36
37
    protected void log(Log logCategory, String message, Throwable t) {
38
        logCategory.info(message,t);
39
    }
36
}
40
}
37
41
(-)src/org/apache/taglibs/log/LoggerTag.java (-2 / +16 lines)
Lines 34-39 Link Here
34
    
34
    
35
    private String category;
35
    private String category;
36
    private String message;
36
    private String message;
37
    private Throwable t;
37
38
38
    
39
    
39
    public void setCategory(String category) {
40
    public void setCategory(String category) {
Lines 44-49 Link Here
44
        this.message = message;
45
        this.message = message;
45
    }
46
    }
46
    
47
    
48
    public void setException(Throwable t) {
49
        this.t = t;
50
    }
51
    
47
    // Tag interface
52
    // Tag interface
48
    //------------------------------------------------------------------------- 
53
    //------------------------------------------------------------------------- 
49
    public int doStartTag() throws JspException  {
54
    public int doStartTag() throws JspException  {
Lines 51-57 Link Here
51
            Log logCategory = getLoggingCategory();
56
            Log logCategory = getLoggingCategory();
52
            if ( isEnabled( logCategory ) ) {
57
            if ( isEnabled( logCategory ) ) {
53
                // Log now as doAfterBody() may not be called for an empty tag 
58
                // Log now as doAfterBody() may not be called for an empty tag 
54
                log( logCategory, message );
59
                if ( t == null ) {
60
                    log( logCategory, message );
61
                } else {
62
                    log( logCategory, message, t );
63
                }
55
            }
64
            }
56
            return SKIP_BODY;
65
            return SKIP_BODY;
57
        }
66
        }
Lines 62-68 Link Here
62
        if (message == null) {
71
        if (message == null) {
63
            Log logCategory = getLoggingCategory();
72
            Log logCategory = getLoggingCategory();
64
            if ( isEnabled( logCategory ) ) {
73
            if ( isEnabled( logCategory ) ) {
65
                log( logCategory, getBodyContent().getString().trim() );
74
                if ( t == null ) {
75
                    log( logCategory, getBodyContent().getString().trim() );
76
                } else {
77
                    log( logCategory, getBodyContent().getString().trim(), t );
78
                }
66
            }
79
            }
67
        }
80
        }
68
        return SKIP_BODY;
81
        return SKIP_BODY;
Lines 72-77 Link Here
72
    //------------------------------------------------------------------------- 
85
    //------------------------------------------------------------------------- 
73
    protected abstract boolean isEnabled(Log logCategory);
86
    protected abstract boolean isEnabled(Log logCategory);
74
    protected abstract void log(Log logCategory, String message);
87
    protected abstract void log(Log logCategory, String message);
88
    protected abstract void log(Log logCategory, String message, Throwable t);
75
    
89
    
76
    protected Log getLoggingCategory() {
90
    protected Log getLoggingCategory() {
77
        if ( category == null ) {
91
        if ( category == null ) {
(-)src/org/apache/taglibs/log/WarnTag.java (+4 lines)
Lines 33-37 Link Here
33
    protected void log(Log logCategory, String message) {
33
    protected void log(Log logCategory, String message) {
34
        logCategory.warn(message);
34
        logCategory.warn(message);
35
    }
35
    }
36
37
    protected void log(Log logCategory, String message, Throwable t) {
38
        logCategory.warn(message,t);
39
    }
36
}
40
}
37
41
(-)xml/log.xml (+45 lines)
Lines 118-123 Link Here
118
          If this is not specified then the body of the tag is used instead.
118
          If this is not specified then the body of the tag is used instead.
119
        </description>
119
        </description>
120
      </attribute>
120
      </attribute>
121
      <attribute>
122
        <name>exception</name>
123
        <rtexprvalue>true</rtexprvalue>
124
        <required>false</required>
125
        <description>
126
          The exception to log. 
127
          If this is not specified then only the message will be logged.
128
        </description>
129
      </attribute>
121
      <restrictions></restrictions>
130
      <restrictions></restrictions>
122
      <example><usage>
131
      <example><usage>
123
          <comment>
132
          <comment>
Lines 157-162 Link Here
157
          If this is not specified then the body of the tag is used instead.
166
          If this is not specified then the body of the tag is used instead.
158
        </description>
167
        </description>
159
      </attribute>
168
      </attribute>
169
      <attribute>
170
        <name>exception</name>
171
        <rtexprvalue>true</rtexprvalue>
172
        <required>false</required>
173
        <description>
174
          The exception to log. 
175
          If this is not specified then only the message will be logged.
176
        </description>
177
      </attribute>
160
      <restrictions></restrictions>
178
      <restrictions></restrictions>
161
      <example><usage>
179
      <example><usage>
162
          <comment>
180
          <comment>
Lines 196-201 Link Here
196
          If this is not specified then the body of the tag is used instead.
214
          If this is not specified then the body of the tag is used instead.
197
        </description>
215
        </description>
198
      </attribute>
216
      </attribute>
217
      <attribute>
218
        <name>exception</name>
219
        <rtexprvalue>true</rtexprvalue>
220
        <required>false</required>
221
        <description>
222
          The exception to log. 
223
          If this is not specified then only the message will be logged.
224
        </description>
225
      </attribute>
199
      <restrictions></restrictions>
226
      <restrictions></restrictions>
200
      <example><usage>
227
      <example><usage>
201
          <comment>
228
          <comment>
Lines 235-240 Link Here
235
          If this is not specified then the body of the tag is used instead.
262
          If this is not specified then the body of the tag is used instead.
236
        </description>
263
        </description>
237
      </attribute>
264
      </attribute>
265
      <attribute>
266
        <name>exception</name>
267
        <rtexprvalue>true</rtexprvalue>
268
        <required>false</required>
269
        <description>
270
          The exception to log. 
271
          If this is not specified then only the message will be logged.
272
        </description>
273
      </attribute>
238
      <restrictions></restrictions>
274
      <restrictions></restrictions>
239
      <example><usage>
275
      <example><usage>
240
          <comment>
276
          <comment>
Lines 274-279 Link Here
274
          If this is not specified then the body of the tag is used instead.
310
          If this is not specified then the body of the tag is used instead.
275
        </description>
311
        </description>
276
      </attribute>
312
      </attribute>
313
      <attribute>
314
        <name>exception</name>
315
        <rtexprvalue>true</rtexprvalue>
316
        <required>false</required>
317
        <description>
318
          The exception to log. 
319
          If this is not specified then only the message will be logged.
320
        </description>
321
      </attribute>
277
      <restrictions></restrictions>
322
      <restrictions></restrictions>
278
      <example><usage>
323
      <example><usage>
279
          <comment>
324
          <comment>

Return to bug 40500