[1] UltraMonkey-L7 (v3.1.2-1) | 2014-09-19 11:41 |
[2] UltraMonkey(L4) () | 2019-09-26 18:24 |
[3] SSL Proxy (1.0.2-0) | 2009-08-24 23:30 |
[4] Resource Agents for Heartbeat2 (SSL Proxy RA for Heartbeat 2.1.4) | 2010-09-22 11:14 |
log4cxx (0.10.0-1) | 2012-11-09 15:27 |
---
Debugで出力するLogは基本的に以下の情報を出力する。
以下必要な情報は随時追加
---
---
example. jsp
- <%@ page language="java" contentType="text/html; charset=ASCII" %>
- <%@ page import="org.apache.log4j*" %>
- <%@ page import="org.ultramonkey.l7.model.*" %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html"; charset=ASCII">
- <title>sample</title>
- <body>
- <%
- Logger logger = Logger.getLogger( LogCategorySet.JSPCategory );
- if( logger.isDebugEnable() ){
- logger.debug( "sample.jsp start" );
- }
- SampleClass sampleClass = SampleClass.getInstance();
- if( null == sampleClass ){
- logger.error( "SampleClass.getInstance() is NULL!" );
- }
- %>
- hello world!
- <%
- if( logger.isDebugEnable() ){
- logger.debug( "sample.jsp exit" );
- }
- %>
- </body>
- </html>
example class
- package org.ultramonkey.l7;
- import org.apache.log4j.*;
- public class Sample{
- Logger logger = null;
- public Sample(){
- logger = Logger.getInstance( LogCategorySet.SampleCategory );
- if( logger.isDebugEnable() ){
- logger.debug( "class Sample created." );
- }
- }
- public String foo(Sample sample, String string) throws Exception {
- // debug log (in method)
- if( logger.isDebugEnable() ){
- StringBuffer buf = new StringBuffer();
- buf.append("Sample::foo(Sample sample, String string) throws Exception in ");
- buf.append("sample=" + sample + ", ");
- buf.append("string=" + string);
- logger.debug(buf.toString());
- }
- if( null != sample ){
- logger.error( "in sample value is null. check configure" );
- }
- // debug log (out method)
- if( logger.isDebugEnable() ){
- StringBuffer buf = new StringBuffer();
- buf.append("Sample::foo(Sample sample, String string) throws Exception out ");
- buf.append("return=" + sample.toString + string);
- logger.debug(buf.toString());
- }
- return sample.toString + string;
- }
- }
[PageInfo]
LastUpdate: 2012-11-11 06:08:39, ModifiedBy: anonymous
[License]
GNU Free Documentation License
[Permissions]
view:all, edit:all, delete/config:all