---
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 void Sample(){
- logger = Logger.getInstance();
- if( logger.isDebugEnable() ){
- logger.debug( "class Sample created." );
- }
- }
- public foo( Sample sample ) throws Exception {
- if( logger.isDebugEnable() ){
- StringBuffer buf = new StringBuffer();
- buf.append( "Sample::foo( Sample sample ) throws Exception in sample = " );
- if( null != sample ){
- buf.append( sample );
- }
- else{
- buf.append( " is NULL" );
- }
- logger.debug( buf.toString() );
- }
- if( null != sample ){
- logger.error( "in sample value is null. check configure" );
- }
- }
- }