[go: up one dir, main page]

Menu

[r1]: / Read Me.txt  Maximize  Restore  History

Download this file

185 lines (159 with data), 8.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
############################## Configuration's Aim #################################
This library's aim is...
In develope we use many framework and tools.
developer's important work is developing PL/SQL.
Many tools and Framework support All Layers.
View, Model, and Controller or DataAcess Layer...
So developer can concentrate business logic. And i think business logics is PL/SQL.
All PL/SQL works repeat Make query And executioning And debugging.
In that case we can use only jdbc or Connection Pooling(Apache DBCP) or support 2PC(JTA,JOTM).
In many case Also we use ORM(Object Relation Mapping) ibatis or springJDBC or hibernate...
Then problem occurs "My Query How to Work! And Parameters is correct?"
So I think easy And light Configuration change But Very Usefull!
############################## Configuration's Aim #################################
Configuration file location is [nano-log.jar]/log/position_ko_KR.properties
if you open useing any text editor then like below
#DEBUG=0,INFO=1,WARNING=2,FATAL=3, ERROR=4, LOGGING_OFF=5
log.level=0
query.logging.position.fixed.select=true
query.logging.position.fixed.none_select=true
query.logging.position.select=8
query.logging.position.none_select=9
query.logging.view.position=true
############################## installation #################################
1. first you copy nano-log.jar in your classpath
2. change your configuration driivers below
-below-
if you use ORACLE_DRIVER then
<driver type="oracle.jdbc.driver.OracleDriver">
To
<driver type="core.log.jdbc.driver.OracleDriver">
Other dervier's driver class name is below
-below-
MYSQL_DRIVER="com.mysql.jdbc.Driver";
SYBASE_DRIVER="com.sybase.jdbc3.jdbc.SybDriver";
MSSQL_DRIVER="com.microsoft.jdbc.sqlserver.SQLServerDriver";
DB2_DRIVER="com.ibm.db2.jcc.DB2Driver";
INFOMIX_DRIVER="com.informix.jdbc.IfxDriver";
POSTGRESQL_DRIVER="org.postgresql.Driver";
MAXDB_DRIVER="com.sap.dbtech.jdbc.DriverSapDB";
FRONTBASE_DRIVER="com.frontbase.jdbc.FBJDriver";
HSQL_DRIVER="org.hsqldb.jdbcDriver";
POINTBASE_DRIVER="com.pointbase.jdbc.jdbcUniversalDriver";
MIMER_DRIVER="com.mimer.jdbc.Driver";
PERVASIVE_DRIVER="com.pervasive.jdbc.v2.Driver";
DAFFODILDB_DRIVER="in.co.daffodil.db.jdbc.DaffodilDBDriver";
JDATASTORE_DRIVER="com.borland.datastore.jdbc.DataStoreDriver";
CACHE_DRIVER="com.intersys.jdbc.CacheDriver";
DERBY_DRIVER="org.apache.derby.jdbc.ClientDriver";
############################## installation #################################
############################## configuration #################################
1.
log.level means
like Log4j's log level default log level is debug.
if you change log level else 0 then you will see upper log that your choice log level
ex)
[2007-11-02 16:58:32] [DEBUG]¡ºcom.sds.maxigent.webconsole.common.GeneralDAO:selectData(38)¡» Elapsed Time [0:00:00.000]
SELECT SYS_GUID() FROM DUAL
2.
query.logging.position.fixed.select means
In select query...
this library can use many case developement. so we don't know your source arch.
if you chang value 'false' then log will trace excutioning.
ex)
[Position Check Start :
SELECT SESSION_ID, USER_ID, LOGIN_DATE, REP_IP, LOGOUT_DATE, LOGOUT_TYPE, RAW_SESSION_ID
FROM G_LOGIN_LOG
WHERE SESSION_ID = 'AC97E8835EDF42448CC2BAD471A34E5F' /**¨Ü*/
]
############## BELOW MESSAGE IS TRACE. NO ERROR! ##############
[0] at core.log.logger.SL.getMessageThrowable(SL.java:178)
[1] at core.log.logger.SL.logSqlSelect(SL.java:311)
[2] at core.log.aop.reflection.handler.DaoInfo.loggingDaoR(DaoInfo.java:122)
[3] at core.log.aop.reflection.handler.DaoInfo.doAround(DaoInfo.java:87)
[4] at core.log.aop.reflection.profiler.AroundProfiler.invoke(AroundProfiler.java:18)
[5] at $Proxy0.executeQuery(Unknown Source)
[6] at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[7] at com.sds.maxigent.webconsole.dao.DBFunction.getDataList(DBFunction.java:435)
[8] at com.sds.maxigent.webconsole.common.GeneralDAO.selectData(GeneralDAO.java:38)
[9] at com.sds.maxigent.webconsole.admin.login.SessionManager.getSessionInfoById(SessionManager.java:57)
[10] at com.sds.maxigent.webconsole.admin.login.SessionManager.createSessionInfo(SessionManager.java:37)
[11] at com.sds.maxigent.webcons...
[Position Check End]
3.
query.logging.position.fixed.none_select means
In update, delete, insert query...
this library can use many case developement. so we don't know your source arch.
if you chang value 'false' then log will trace excutioning.
ex)
[Position Check Start :
INSERT INTO G_LOGIN_LOG (SESSION_ID, USER_ID, LOGIN_DATE, REP_IP,
LOGOUT_DATE, LOGOUT_TYPE, RAW_SESSION_ID)
VALUES( 'AC97E8835EDF42448CC2BAD471A34E5F' /**¨Ü*/, 'maxigent' /**¨Ü*/, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS'), '127.0.0.1' /**¨Ü*/, '', '', 'abcAMYmu93sIbgx8Kx-xr' /**¨Ü*/)
]
############## BELOW MESSAGE IS TRACE. NO ERROR! ##############
[0] at core.log.logger.SL.getMessageThrowable(SL.java:178)
[1] at core.log.logger.SL.logSqlNoneSelect(SL.java:322)
[2] at core.log.aop.reflection.handler.DaoInfo.loggingDaoCUD(DaoInfo.java:170)
[3] at core.log.aop.reflection.handler.DaoInfo.doAround(DaoInfo.java:90)
[4] at core.log.aop.reflection.profiler.AroundProfiler.invoke(AroundProfiler.java:18)
[5] at $Proxy0.executeUpdate(Unknown Source)
[6] at com.caucho.sql.UserPreparedStatement.executeUpdate(UserPreparedStatement.java:117)
[7] at com.caucho.sql.UserPreparedStatement.executeUpdate(UserPreparedStatement.java:117)
[8] at com.sds.maxigent.webconsole.dao.DBFunction.insertData(DBFunction.java:113)
[9] at com.sds.maxigent.webconsole.common.GeneralDAO.insertData(GeneralDAO.java:69)
[10] at com.sds.maxigent.webconsole.admin.login.SessionManager.createSessionInfo(SessionManager.java:35)
[11] at com.sds.maxigent.webcons...
[Position Check End]
4.
query.logging.position.select means
the logging position what you want to see.
this example's 'query.logging.position.select=8' so you can see below
-below-
[2007-11-02 16:58:32] [DEBUG]¡ºcom.sds.maxigent.webconsole.common.GeneralDAO:selectData(38)¡» Elapsed Time [0:00:00.000]
SELECT SESSION_ID, USER_ID, LOGIN_DATE, REP_IP, LOGOUT_DATE, LOGOUT_TYPE, RAW_SESSION_ID
FROM G_LOGI...
[0] at core.log.logger.SL.getMessageThrowable(SL.java:178)
[1] at core.log.logger.SL.logSqlSelect(SL.java:311)
[2] at core.log.aop.reflection.handler.DaoInfo.loggingDaoR(DaoInfo.java:122)
[3] at core.log.aop.reflection.handler.DaoInfo.doAround(DaoInfo.java:87)
[4] at core.log.aop.reflection.profiler.AroundProfiler.invoke(AroundProfiler.java:18)
[5] at $Proxy0.executeQuery(Unknown Source)
[6] at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[7] at com.sds.maxigent.webconsole.dao.DBFunction.getDataList(DBFunction.java:435)
-->[8] at com.sds.maxigent.webconsole.common.GeneralDAO.selectData(GeneralDAO.java:38)
[9] at com.sds.maxigent.webconsole.admin.login.SessionManager.getSessionInfoById(SessionManager.java:57)
[10] at com.sds.maxigent.webco...
5.
query.logging.position.none_select means same upper in insert, update, delete
6.
query.logging.view.position means
Our aim to logging sql is target preparedstatement's level(also logging statement).
Parameters matched in query But SM developers dont know where is parameter where is hardcoded.
so we suppose that. sigh is '/**¨Ü*/'
if you 'query.logging.view.position=true' then
ex)
SELECT a.MENU_SEQ
, a.INSERT_YN
, a.UPDATE_YN
, a.DELETE_YN
from G_ASSIGN_M_GROUP a
where a.GROUP_CODE = '000000000001' /**¨Ü*/
if you 'query.logging.view.position=false' then
ex)
SELECT a.MENU_SEQ
, a.INSERT_YN
, a.UPDATE_YN
, a.DELETE_YN
from G_ASSIGN_M_GROUP a
where a.GROUP_CODE = '000000000001'
############################## configuration #################################
############################## Author information #################################
if you any question go to http://insup.blogspot.com
and write your message. asp I'll explain of your question if i possible.
Blog : http://insup.blogspot.com
Mail : insup74@empal.com
Google Code : nano-log[involved]
Sourceforge.net : jorm[Status APT]
Good luck!
############################## Author information #################################